From 6262d351b777443bee2a1b5b534082268ebe72f9 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 Mar 2024 10:00:02 +0100 Subject: fix deprecation warning and add test --- tests/unit/Lib/ActivityTest.php | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/unit/Lib/ActivityTest.php (limited to 'tests/unit') diff --git a/tests/unit/Lib/ActivityTest.php b/tests/unit/Lib/ActivityTest.php new file mode 100644 index 000000000..38c3d584c --- /dev/null +++ b/tests/unit/Lib/ActivityTest.php @@ -0,0 +1,42 @@ +assertEquals($expected, Activity::get_textfield($src, 'content')); + } + + /** + * Dataprovider for test_get_textfield. + */ + private function get_textfield_provider(): array { + return [ + 'get content field' => [ + ['content' => 'Some content'], + 'Some content' + ], + 'get content from map' => [ + ['contentMap' => ['en' => 'Some content']], + [ + 'en' => 'Some content' + ] + ], + 'get not available content' => [ + ['some_field' => 'Some content'], + null + ] + ]; + } + +} -- cgit v1.2.3