diff --git a/tests/UI/AbstractFactoryTest.php b/tests/UI/AbstractFactoryTest.php index c61a0198e18d..f133de75015c 100644 --- a/tests/UI/AbstractFactoryTest.php +++ b/tests/UI/AbstractFactoryTest.php @@ -1,7 +1,5 @@ factory_title); } - final public function methods_provider(): array + final public function getMethodsProvider(): array { $reflection = $this->buildFactoryReflection(); return array_filter( @@ -123,7 +123,7 @@ public function setUp(): void $this->reflection = $this->buildFactoryReflection(); } - public function test_proper_namespace(): void + public function testProperNamespace(): void { $message = "TODO: Put your factory into the proper namespace."; $this->assertMatchesRegularExpression( @@ -133,7 +133,7 @@ public function test_proper_namespace(): void ); } - public function test_proper_name(): void + public function testProperName(): void { $name = $this->reflection->getName(); $message = "TODO: Give your factory a proper name."; @@ -143,9 +143,9 @@ public function test_proper_name(): void /** * Tests whether the YAML Kitchen Sink info can be parsed. * - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_check_yaml_extraction(ReflectionMethod $method_reflection, string $name): array + final public function testCheckYamlExtraction(ReflectionMethod $method_reflection, string $name): array { try { //Todo (TA) this is not pretty. We should think about using only reflection in the parser as well. @@ -165,12 +165,12 @@ final public function test_check_yaml_extraction(ReflectionMethod $method_reflec /** * Tests whether the method either returns a factory or a component. * - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_return_type(ReflectionMethod $method_reflection, string $name): void + final public function testReturnType(ReflectionMethod $method_reflection, string $name): void { $message = "TODO ($name): fix return type, it must be a factory or a component."; - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); if ($this->returnsFactory($docstring_data)) { $this->assertTrue(true); } elseif ($this->returnsComponent($docstring_data)) { @@ -183,18 +183,18 @@ final public function test_return_type(ReflectionMethod $method_reflection, stri /** * Tests whether the method name matches the return doctring? * - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_factory_method_name_compatible_docstring( + final public function testFactoryMethodNameCompatibleDocstring( ReflectionMethod $method_reflection, string $name ): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $this->test_return_type($method_reflection, $name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $this->testReturnType($method_reflection, $name); $return_doc = $docstring_data["namespace"]; $name_uppercase = ucwords($name); - $regex_factory_namespace = $this->get_regex_factory_namespace(); + $regex_factory_namespace = $this->getRegexFactoryNamespace(); $regex_head = "#^(\\\\?)$regex_factory_namespace"; $message = "TODO ($name): fix @return, it does not match the method name."; @@ -219,7 +219,7 @@ final public function test_factory_method_name_compatible_docstring( } } - protected function get_regex_factory_namespace(): string + protected function getRegexFactoryNamespace(): string { return str_replace("\\", "\\\\", $this->reflection->getNamespaceName()); } @@ -227,11 +227,11 @@ protected function get_regex_factory_namespace(): string /** * Tests whether methods returning factories have no parameters. * - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_method_params(ReflectionMethod $method_reflection, string $name): void + final public function testMethodParams(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); if ($this->returnsFactory($docstring_data)) { $message = "TODO ($name): remove params from method that returns Factory."; $this->assertEquals(0, $method_reflection->getNumberOfParameters(), $message); @@ -242,12 +242,12 @@ final public function test_method_params(ReflectionMethod $method_reflection, st // factories or components. /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_description(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoDescription(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if ($kitchensink_info_settings['description']) { $message = "TODO ($name): add a description."; @@ -266,11 +266,11 @@ final public function test_kitchensink_info_description(ReflectionMethod $method } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_rivals(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoRivals(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); if (isset($docstring_data["description"]) && isset($docstring_data["description"]["rivals"])) { $rules = $docstring_data["description"]["rivals"]; $message = "TODO ($name): The Rivals field has a non-string index. Format like 'rival_name': 'description'"; @@ -280,12 +280,12 @@ final public function test_kitchensink_info_rivals(ReflectionMethod $method_refl } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_background(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoBackground(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if ($kitchensink_info_settings['background']) { $message = "TODO ($name): add a background field."; @@ -294,12 +294,12 @@ final public function test_kitchensink_info_background(ReflectionMethod $method_ } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_featurewiki(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoFeatureWiki(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if ($kitchensink_info_settings['featurewiki']) { $message = "TODO ($name): add a featurewiki field."; @@ -308,12 +308,12 @@ final public function test_kitchensink_info_featurewiki(ReflectionMethod $method } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_javascript(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoJavaScript(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if ($kitchensink_info_settings['javascript']) { $message = "TODO ($name): add a javascript field."; @@ -322,12 +322,12 @@ final public function test_kitchensink_info_javascript(ReflectionMethod $method_ } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_rules(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoRules(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if ($kitchensink_info_settings['rules']) { $message = "TODO ($name): add a rules field."; @@ -346,19 +346,19 @@ final public function test_kitchensink_info_rules(ReflectionMethod $method_refle } /** - * @dataProvider methods_provider + * @dataProvider getMethodsProvider */ - final public function test_kitchensink_info_context(ReflectionMethod $method_reflection, string $name): void + final public function testKitchensinkInfoContext(ReflectionMethod $method_reflection, string $name): void { - $docstring_data = $this->test_check_yaml_extraction($method_reflection, $name); - $kitchensink_info_settings = $this->kitchensink_info_settings_merged_with_defaults($name); + $docstring_data = $this->testCheckYamlExtraction($method_reflection, $name); + $kitchensink_info_settings = $this->kitchensinkInfoSettingsMergedWithDefaults($name); if (!$this->returnsFactory($docstring_data) && $kitchensink_info_settings["context"]) { $message = "TODO ($name): factory method returning component should have context field. Add it."; $this->assertArrayHasKey("context", $docstring_data, $message); } } - final public function kitchensink_info_settings_merged_with_defaults(string $name): array + final public function kitchensinkInfoSettingsMergedWithDefaults(string $name): array { if (array_key_exists($name, $this->kitchensink_info_settings)) { return array_merge( diff --git a/tests/UI/Component/Breadcrumbs/BreadcrumbsTest.php b/tests/UI/Component/Breadcrumbs/BreadcrumbsTest.php index 358167bf1952..088fba307d37 100644 --- a/tests/UI/Component/Breadcrumbs/BreadcrumbsTest.php +++ b/tests/UI/Component/Breadcrumbs/BreadcrumbsTest.php @@ -1,7 +1,5 @@ getFactory(); diff --git a/tests/UI/Component/Button/BulkyButtonTest.php b/tests/UI/Component/Button/BulkyButtonTest.php index 67d83264c123..9d107ab5cc3a 100644 --- a/tests/UI/Component/Button/BulkyButtonTest.php +++ b/tests/UI/Component/Button/BulkyButtonTest.php @@ -1,7 +1,5 @@ icon = new I\Component\Symbol\Icon\Standard("someExample", "Example", "small", false); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $this->assertInstanceOf( "ILIAS\\UI\\Component\\Button\\Bulky", @@ -48,7 +48,7 @@ public function test_implements_factory_interface(): void ); } - public function test_construction_icon_type_wrong(): void + public function testConstructionIconTypeWrong(): void { $this->expectException(TypeError::class); @@ -58,7 +58,7 @@ public function test_construction_icon_type_wrong(): void $f->bulky($c, "", "http://www.ilias.de"); } - public function test_glyph_or_icon_for_glyph(): void + public function testGlyphOrIconForGlyph(): void { $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de"); $this->assertEquals( @@ -67,7 +67,7 @@ public function test_glyph_or_icon_for_glyph(): void ); } - public function test_glyph_or_icon_for_icon(): void + public function testGlyphOrIconForIcon(): void { $b = $this->button_factory->bulky($this->icon, "label", "http://www.ilias.de"); $this->assertEquals( @@ -76,7 +76,7 @@ public function test_glyph_or_icon_for_icon(): void ); } - public function test_engaged(): void + public function testEngaged(): void { $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de"); $this->assertFalse($b->isEngaged()); @@ -91,7 +91,7 @@ public function test_engaged(): void $this->assertTrue($b->isEngageable()); } - public function test_engageable_disengaged(): void + public function testEngageableDisengaged(): void { $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de"); $this->assertFalse($b->isEngaged()); @@ -106,7 +106,7 @@ public function test_engageable_disengaged(): void $this->assertTrue($b->isEngageable()); } - public function test_with_aria_role(): void + public function testWithAriaRole(): void { try { $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de") @@ -117,7 +117,7 @@ public function test_with_aria_role(): void } } - public function test_with_aria_role_incorrect(): void + public function testWithAriaRoleIncorrect(): void { try { $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de") @@ -128,7 +128,7 @@ public function test_with_aria_role_incorrect(): void } } - public function test_render_with_glyph_in_context(): void + public function testRenderWithGlyphInContext(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de"); @@ -139,7 +139,7 @@ public function test_render_with_glyph_in_context(): void ); } - public function test_render_with_glyph_in_context_and_engaged(): void + public function testRenderWithGlyphInContextAndEngaged(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de") @@ -151,7 +151,7 @@ public function test_render_with_glyph_in_context_and_engaged(): void ); } - public function test_render_with_glyph_in_context_and_disengaged(): void + public function testRenderWithGlyphInContextAndDisengaged(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->glyph, "label", "http://www.ilias.de") @@ -184,7 +184,7 @@ protected function getHtmlWithGlyph(bool $engeagable = false, bool $engeaged = f . ''; } - public function test_render_with_icon(): void + public function testRenderWithIcon(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->icon, "label", "http://www.ilias.de"); @@ -201,7 +201,7 @@ public function test_render_with_icon(): void ); } - public function test_render_button_with_aria_role_menuitem_not_engageable(): void + public function testRenderButtonWithAriaRoleMenuitemNotEngageable(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->icon, "label", "http://www.ilias.de") @@ -219,7 +219,7 @@ public function test_render_button_with_aria_role_menuitem_not_engageable(): voi ); } - public function test_render_button_with_aria_role_menuitem_is_engageable(): void + public function testRenderButtonWithAriaRoleMenuitemIsEngageable(): void { $r = $this->getDefaultRenderer(); $b = $this->button_factory->bulky($this->icon, "label", "http://www.ilias.de") diff --git a/tests/UI/Component/Button/ButtonFactoryTest.php b/tests/UI/Component/Button/ButtonFactoryTest.php index 75d1146b188c..2a4a4da83f75 100644 --- a/tests/UI/Component/Button/ButtonFactoryTest.php +++ b/tests/UI/Component/Button/ButtonFactoryTest.php @@ -1,7 +1,5 @@ getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->month("02-2017")); } - public function test_get_default(): void + public function testGetDefault(): void { $f = $this->getFactory(); $c = $f->month("02-2017"); @@ -48,7 +48,7 @@ public function test_get_default(): void $this->assertEquals("02-2017", $c->getDefault()); } - public function test_render(): void + public function testRender(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Button/ButtonTest.php b/tests/UI/Component/Button/ButtonTest.php index 6c4cb58be8c1..bf7dbbc07aac 100644 --- a/tests/UI/Component/Button/ButtonTest.php +++ b/tests/UI/Component/Button/ButtonTest.php @@ -1,7 +1,5 @@ "btn btn-tag btn-tag-relevance-veryhigh" ]; - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $f = $this->getButtonFactory(); @@ -69,9 +69,9 @@ public function test_implements_factory_interface(): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_label_or_glyph_only(string $factory_method): void + public function testButtonLabelOrGlyphOnly(string $factory_method): void { $this->expectException(TypeError::class); $f = $this->getButtonFactory(); @@ -79,9 +79,9 @@ public function test_button_label_or_glyph_only(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_string_action_only(string $factory_method): void + public function testButtonStringActionOnly(string $factory_method): void { $this->expectException(InvalidArgumentException::class); $f = $this->getButtonFactory(); @@ -89,9 +89,9 @@ public function test_button_string_action_only(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_label(string $factory_method): void + public function testButtonLabel(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -100,9 +100,9 @@ public function test_button_label(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_with_label(string $factory_method): void + public function testButtonWithLabel(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -114,9 +114,9 @@ public function test_button_with_label(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_action(string $factory_method): void + public function testButtonAction(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -125,9 +125,9 @@ public function test_button_action(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_activated_on_default(string $factory_method): void + public function testButtonActivatedOnDefault(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -136,9 +136,9 @@ public function test_button_activated_on_default(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_deactivation(string $factory_method): void + public function testButtonDeactivation(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de") @@ -151,7 +151,7 @@ public function test_button_deactivation(string $factory_method): void /** * test loading animation */ - public function test_button_with_loading_animation(): void + public function testButtonWithLoadingAnimation(): void { $f = $this->getButtonFactory(); foreach (["standard", "primary"] as $method) { @@ -166,9 +166,9 @@ public function test_button_with_loading_animation(): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_label(string $factory_method): void + public function testRenderButtonLabel(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -185,9 +185,9 @@ public function test_render_button_label(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_disabled(string $factory_method): void + public function testRenderButtonDisabled(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -204,7 +204,7 @@ public function test_render_button_disabled(string $factory_method): void $this->assertHTMLEquals($expected, $html); } - public function test_render_close_button(): void + public function testRenderCloseButton(): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -218,7 +218,7 @@ public function test_render_close_button(): void $this->assertEquals($expected, $html); } - public function test_render_minimize_button(): void + public function testRenderMinimizeButton(): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -233,9 +233,9 @@ public function test_render_minimize_button(): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_with_on_load_code(string $factory_method): void + public function testRenderButtonWithOnLoadCode(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -259,7 +259,7 @@ public function test_render_button_with_on_load_code(string $factory_method): vo $this->assertHTMLEquals($expected, $html); } - public function test_____render_close_button_with_on_load_code(): void + public function testRenderCloseButtonWithOnLoadCode(): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -281,7 +281,7 @@ public function test_____render_close_button_with_on_load_code(): void $this->assertEquals($expected, $html); } - public function test_btn_tag_relevance(): void + public function testBtnTagRelevance(): void { $f = $this->getButtonFactory(); $b = $f->tag('tag', '#'); @@ -293,7 +293,7 @@ public function test_btn_tag_relevance(): void $b->withRelevance('notsoimportant'); } - public function test_render_btn_tag_relevance(): void + public function testRenderBtnTagRelevance(): void { $expectations = array( '', @@ -322,7 +322,7 @@ public function test_render_btn_tag_relevance(): void } } - public function test_render_btn_tag_colors(): void + public function testRenderBtnTagColors(): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -343,7 +343,7 @@ public function test_render_btn_tag_colors(): void $this->assertEquals($expected, $html); } - public function test_render_btn_tag_classes(): void + public function testRenderBtnTagClasses(): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -360,9 +360,9 @@ public function test_render_btn_tag_classes(): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_with_aria_label(string $factory_method): void + public function testButtonWithAriaLabel(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de")->withAriaLabel("ariatext"); @@ -370,9 +370,9 @@ public function test_button_with_aria_label(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_with_engageable(string $factory_method): void + public function testButtonWithEngageable(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -386,9 +386,9 @@ public function test_button_with_engageable(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_with_engaged(string $factory_method): void + public function testButtonWithEngaged(string $factory_method): void { $f = $this->getButtonFactory(); $b = $f->$factory_method("label", "http://www.ilias.de"); @@ -403,9 +403,9 @@ public function test_button_with_engaged(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_with_aria_label(string $factory_method): void + public function testRenderButtonWithAriaLabel(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -422,9 +422,9 @@ public function test_render_button_with_aria_label(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_with_aria_pressed(string $factory_method): void + public function testRenderButtonWithAriaPressed(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -446,9 +446,9 @@ public function test_render_button_with_aria_pressed(string $factory_method): vo } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_withOnClick_removes_action(string $factory_method): void + public function testWithOnClickRemovesAction(string $factory_method): void { $f = $this->getButtonFactory(); $signal = $this->createMock(C\Signal::class); @@ -461,9 +461,9 @@ public function test_withOnClick_removes_action(string $factory_method): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_appendOnClick_appends_to_action(string $factory_method): void + public function testAppendOnClickAppendsToAction(string $factory_method): void { $f = $this->getButtonFactory(); $signal1 = $this->createMock(C\Signal::class); @@ -476,9 +476,9 @@ public function test_appendOnClick_appends_to_action(string $factory_method): vo } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_render_button_with_signal(string $factory_method): void + public function testRenderButtonWithSignal(string $factory_method): void { $ln = "http://www.ilias.de"; $f = $this->getButtonFactory(); @@ -502,7 +502,7 @@ public function test_render_button_with_signal(string $factory_method): void /** * test rendering with on click animation */ - public function test_render_button_with_on_click_animation(): void + public function testRenderButtonWithOnClickAnimation(): void { foreach (["primary", "standard"] as $method) { $ln = "http://www.ilias.de"; @@ -522,9 +522,9 @@ public function test_render_button_with_on_click_animation(): void } /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_button_renders_tooltip(string $factory_method): void + public function testButtonRendersTooltip(string $factory_method): void { $f = $this->getButtonFactory(); $r = $this->getDefaultRenderer(); @@ -555,9 +555,9 @@ public function test_button_renders_tooltip(string $factory_method): void // here. Does it still render the action js? /** - * @dataProvider button_type_provider + * @dataProvider getButtonTypeProvider */ - public function test_factory_accepts_signal_as_action(string $factory_method): void + public function testFactoryAcceptsSignalAsAction(string $factory_method): void { $f = $this->getButtonFactory(); $signal = $this->createMock(C\Signal::class); @@ -567,7 +567,7 @@ public function test_factory_accepts_signal_as_action(string $factory_method): v $this->assertEquals([$signal], $button->getAction()); } - public function button_type_provider(): array + public function getButtonTypeProvider(): array { return [ ['standard'], diff --git a/tests/UI/Component/Button/MinimizeButtonTest.php b/tests/UI/Component/Button/MinimizeButtonTest.php index f6286aaddccc..be0cbdf9db94 100644 --- a/tests/UI/Component/Button/MinimizeButtonTest.php +++ b/tests/UI/Component/Button/MinimizeButtonTest.php @@ -33,7 +33,7 @@ public function setUp(): void $this->button_factory = new I\Component\Button\Factory(); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $this->assertInstanceOf( "ILIAS\\UI\\Component\\Button\\Minimize", diff --git a/tests/UI/Component/Button/ToggleButtonTest.php b/tests/UI/Component/Button/ToggleButtonTest.php index 10d616c49dad..8409800a9efe 100644 --- a/tests/UI/Component/Button/ToggleButtonTest.php +++ b/tests/UI/Component/Button/ToggleButtonTest.php @@ -1,7 +1,5 @@ getFactory(); @@ -45,7 +45,7 @@ public function test_implements_factory_interface(): void ); } - public function test_construction_action_on_type_wrong(): void + public function testConstructionActionOnTypeWrong(): void { $f = $this->getFactory(); try { @@ -56,7 +56,7 @@ public function test_construction_action_on_type_wrong(): void } } - public function test_construction_action_off_type_wrong(): void + public function testConstructionActionOffTypeWrong(): void { $f = $this->getFactory(); try { @@ -67,7 +67,7 @@ public function test_construction_action_off_type_wrong(): void } } - public function test_setOn_on_default(): void + public function testSetOnOnDefault(): void { $f = $this->getFactory(); $button = $f->toggle("label", "action_on_string", "action_off_string", true); @@ -75,7 +75,7 @@ public function test_setOn_on_default(): void $this->assertTrue($button->isEngaged()); } - public function test_append_OnAction(): void + public function testAppendOnAction(): void { $f = $this->getFactory(); $signal_on1 = $this->createMock(Signal::class); @@ -88,7 +88,7 @@ public function test_append_OnAction(): void $this->assertEquals([$signal_on1, $signal_on2], $button->getActionOn()); } - public function test_append_OffAction(): void + public function testAppendOffAction(): void { $f = $this->getFactory(); $signal_off1 = $this->createMock(Signal::class); @@ -100,7 +100,7 @@ public function test_append_OffAction(): void $this->assertEquals([$signal_off1, $signal_off2], $button->getActionOff()); } - public function test_render_with_label(): void + public function testRenderWithLabel(): void { $r = $this->getDefaultRenderer(); $button = $this->getFactory()->toggle("label", "action_on_string", "action_off_string"); @@ -117,7 +117,7 @@ public function test_render_with_label(): void $this->assertHTMLEquals("
" . $expected . "
", "
" . $r->render($button) . "
"); } - public function test_render_setOn_on_default(): Toggle + public function testRenderSetOnOnDefault(): Toggle { $r = $this->getDefaultRenderer(); $button = $this->getFactory()->toggle("", "action_on_string", "action_off_string", true); @@ -133,7 +133,7 @@ public function test_render_setOn_on_default(): Toggle return $button; } - public function test_render_with_signals(): void + public function testRenderWithSignals(): void { $r = $this->getDefaultRenderer(); $signal_on = $this->createMock(Signal::class); @@ -157,9 +157,9 @@ public function test_render_with_signals(): void } /** - * @depends test_render_setOn_on_default + * @depends testRenderSetOnOnDefault */ - public function test_append_UnavailAction(Toggle $button): void + public function testAppendUnavailAction(Toggle $button): void { $r = $this->getDefaultRenderer(); $button = $button->withUnavailableAction(); diff --git a/tests/UI/Component/Card/CardTest.php b/tests/UI/Component/Card/CardTest.php index b66faa6a96f6..e451454ca0b8 100644 --- a/tests/UI/Component/Card/CardTest.php +++ b/tests/UI/Component/Card/CardTest.php @@ -1,7 +1,5 @@ standard("Card Title", $image); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $this->assertInstanceOf("ILIAS\\UI\\Component\\Card\\Standard", $this->getBaseCard()); } - public function test_factory_with_shy_button(): void + public function testFactoryWithShyButton(): void { $button_factory = new I\Component\Button\Factory(); $button = $button_factory->shy("Card Title New", ""); @@ -70,14 +70,14 @@ public function test_factory_with_shy_button(): void $this->assertEquals($button, $cf->standard($button, $image)->getTitle()); } - public function test_get_title(): void + public function testGetTitle(): void { $c = $this->getBaseCard(); $this->assertEquals("Card Title", $c->getTitle()); } - public function test_with_title(): void + public function testWithTitle(): void { $c = $this->getBaseCard(); $c = $c->withTitle("Card Title New"); @@ -85,7 +85,7 @@ public function test_with_title(): void $this->assertEquals("Card Title New", $c->getTitle()); } - public function test_with_title_as_shy_button(): void + public function testWithTitleAsShyButton(): void { $c = $this->getBaseCard(); $button_factory = new I\Component\Button\Factory(); @@ -95,14 +95,14 @@ public function test_with_title_as_shy_button(): void $this->assertEquals($button, $c->getTitle()); } - public function test_with_string_title_action(): void + public function testWithStringTitleAction(): void { $c = $this->getBaseCard(); $c = $c->withTitleAction("newAction"); $this->assertEquals("newAction", $c->getTitleAction()); } - public function test_with_signal_title_action(): void + public function testWithSignalTitleAction(): void { $c = $this->getBaseCard(); $signal = $this->createMock(C\Signal::class); @@ -110,14 +110,14 @@ public function test_with_signal_title_action(): void $this->assertEquals([$signal], $c->getTitleAction()); } - public function test_with_highlight(): void + public function testWithHighlight(): void { $c = $this->getBaseCard(); $c = $c->withHighlight(true); $this->assertTrue($c->isHighlighted()); } - public function test_get_image(): void + public function testGetImage(): void { $card = $this->getBaseCard(); $image = new I\Component\Image\Image("standard", "src", "alt"); @@ -125,7 +125,7 @@ public function test_get_image(): void $this->assertEquals($card->getImage(), $image); } - public function test_with_image(): void + public function testWithImage(): void { $card = $this->getBaseCard(); $image_new = new I\Component\Image\Image("standard", "src/new", "alt"); @@ -134,7 +134,7 @@ public function test_with_image(): void $this->assertEquals($c->getImage(), $image_new); } - public function test_with_section(): void + public function testWithSection(): void { $f = $this->getFactory(); $c = $this->getBaseCard(); @@ -144,7 +144,7 @@ public function test_with_section(): void $this->assertEquals($c->getSections(), array($content)); } - public function test_render_content_full(): void + public function testRenderContentFull(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); @@ -165,7 +165,7 @@ public function test_render_content_full(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $html); } - public function test_render_content_with_highlight(): void + public function testRenderContentWithHighlight(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); diff --git a/tests/UI/Component/Card/RepositoryObjectTest.php b/tests/UI/Component/Card/RepositoryObjectTest.php index e7082180a7c3..34d41fdb75e2 100644 --- a/tests/UI/Component/Card/RepositoryObjectTest.php +++ b/tests/UI/Component/Card/RepositoryObjectTest.php @@ -1,7 +1,5 @@ repositoryObject("Card Title", $image); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $this->assertInstanceOf("ILIAS\\UI\\Component\\Card\\RepositoryObject", $this->getBaseCard()); } - public function test_factory_with_shy_button(): void + public function testFactoryWithShyButton(): void { $button_factory = new I\Component\Button\Factory(); $button = $button_factory->shy("Card Title New", ""); @@ -98,7 +98,7 @@ public function test_factory_with_shy_button(): void $this->assertEquals($button, $cf->repositoryObject($button, $image)->getTitle()); } - public function test_with_object_icon(): void + public function testWithObjectIcon(): void { $icon = new I\Component\Symbol\Icon\Standard("crs", 'Course', 'medium', false); $card = $this->getBaseCard(); @@ -107,7 +107,7 @@ public function test_with_object_icon(): void $this->assertEquals($card->getObjectIcon(), $icon); } - public function test_with_progress(): void + public function testWithProgress(): void { $progressmeter = new I\Component\Chart\ProgressMeter\Mini(100, 70); $card = $this->getBaseCard(); @@ -117,7 +117,7 @@ public function test_with_progress(): void $this->assertEquals($progressmeter, $card->getProgress()); } - public function test_with_certificate_icon(): void + public function testWithCertificateIcon(): void { $card = $this->getBaseCard(); $card_with_cert_true = $card->withCertificateIcon(true); @@ -128,7 +128,7 @@ public function test_with_certificate_icon(): void $this->assertFalse($card_with_cert_false->getCertificateIcon()); } - public function test_with_actions(): void + public function testWithActions(): void { $f = $this->getFactory(); $items = array( @@ -146,7 +146,7 @@ public function test_with_actions(): void $this->assertEquals($card->getActions(), $dropdown); } - public function test_with_title_as_shy(): void + public function testWithTitleAsShy(): void { $c = $this->getBaseCard(); $button_factory = new I\Component\Button\Factory(); @@ -156,7 +156,7 @@ public function test_with_title_as_shy(): void $this->assertEquals($button, $c->getTitle()); } - public function test_render_with_object_icon(): void + public function testRenderWithObjectIcon(): void { $r = $this->getDefaultRenderer(); @@ -188,7 +188,7 @@ public function test_render_with_object_icon(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_with_certificate_icon(): void + public function testRenderWithCertificateIcon(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); @@ -221,7 +221,7 @@ public function test_render_with_certificate_icon(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_with_progressmeter(): void + public function testRenderWithProgressmeter(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); @@ -255,7 +255,7 @@ public function test_render_with_progressmeter(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_with_actions(): void + public function testRenderWithActions(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); diff --git a/tests/UI/Component/Chart/Bar/AxisTest.php b/tests/UI/Component/Chart/Bar/AxisTest.php index fb02d01d2309..4fc3c31ac4d9 100644 --- a/tests/UI/Component/Chart/Bar/AxisTest.php +++ b/tests/UI/Component/Chart/Bar/AxisTest.php @@ -1,7 +1,5 @@ assertEquals("x", $x_axis->getAbbreviation()); } - public function test_y_abbreviation(): void + public function testYAbbreviation(): void { $y_axis = new YAxis(); $this->assertEquals("y", $y_axis->getAbbreviation()); } - public function test_type(): void + public function testType(): void { $x_axis = new XAxis(); @@ -54,7 +54,7 @@ public function test_type(): void $this->assertEquals("linear", $y_axis->getType()); } - public function test_with_displayed(): void + public function testWithDisplayed(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withDisplayed(false); @@ -63,7 +63,7 @@ public function test_with_displayed(): void $this->assertEquals(false, $x_axis1->isDisplayed()); } - public function test_with_step_size(): void + public function testWithStepSize(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withStepSize(0.5); @@ -72,7 +72,7 @@ public function test_with_step_size(): void $this->assertEquals(0.5, $x_axis1->getStepSize()); } - public function test_with_begin_at_zero(): void + public function testWithBeginAtZero(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withBeginAtZero(false); @@ -81,7 +81,7 @@ public function test_with_begin_at_zero(): void $this->assertEquals(false, $x_axis1->isBeginAtZero()); } - public function test_with_min(): void + public function testWithMin(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withMinValue(-2); @@ -90,7 +90,7 @@ public function test_with_min(): void $this->assertEquals(-2, $x_axis1->getMinValue()); } - public function test_with_max(): void + public function testWithMax(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withMaxValue(10); @@ -99,7 +99,7 @@ public function test_with_max(): void $this->assertEquals(10, $x_axis1->getMaxValue()); } - public function test_x_with_position(): void + public function testXWithPosition(): void { $x_axis = new XAxis(); $x_axis1 = $x_axis->withPosition("top"); @@ -108,7 +108,7 @@ public function test_x_with_position(): void $this->assertEquals("top", $x_axis1->getPosition()); } - public function test_x_with_invalid_position(): void + public function testXWithInvalidPosition(): void { $x_axis = new XAxis(); @@ -118,7 +118,7 @@ public function test_x_with_invalid_position(): void $x_axis = $x_axis->withPosition("left"); } - public function test_y_with_position(): void + public function testYWithPosition(): void { $y_axis = new YAxis(); $y_axis1 = $y_axis->withPosition("right"); @@ -127,7 +127,7 @@ public function test_y_with_position(): void $this->assertEquals("right", $y_axis1->getPosition()); } - public function test_y_with_invalid_position(): void + public function testYWithInvalidPosition(): void { $y_axis = new YAxis(); diff --git a/tests/UI/Component/Chart/Bar/BarConfigTest.php b/tests/UI/Component/Chart/Bar/BarConfigTest.php index ebe66e00e86f..ae43f41adec2 100644 --- a/tests/UI/Component/Chart/Bar/BarConfigTest.php +++ b/tests/UI/Component/Chart/Bar/BarConfigTest.php @@ -33,7 +33,7 @@ public function getDataFactory(): ILIAS\Data\Factory return new ILIAS\Data\Factory(); } - public function test_with_color(): void + public function testWithColor(): void { $df = $this->getDataFactory(); @@ -45,7 +45,7 @@ public function test_with_color(): void $this->assertEquals($color, $bc1->getColor()); } - public function test_with_width(): void + public function testWithWidth(): void { $df = $this->getDataFactory(); diff --git a/tests/UI/Component/Chart/Bar/ChartBarTest.php b/tests/UI/Component/Chart/Bar/ChartBarTest.php index a5d8ee0329dd..f40f29d89d0e 100644 --- a/tests/UI/Component/Chart/Bar/ChartBarTest.php +++ b/tests/UI/Component/Chart/Bar/ChartBarTest.php @@ -75,14 +75,14 @@ protected function getExtendedDataset(): \ILIAS\Data\Chart\Dataset return $dataset; } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $f = $this->getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\Bar\\Factory", $f); } - public function test_get_instances(): void + public function testGetInstances(): void { $f = $this->getFactory(); @@ -104,7 +104,7 @@ public function test_get_instances(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\Bar\\Vertical", $vertical); } - public function test_empty_dataset(): void + public function testEmptyDataset(): void { $f = $this->getFactory(); $df = $this->getDataFactory(); @@ -122,7 +122,7 @@ public function test_empty_dataset(): void } /* - public function test_invalid_dataset_dimension() : void + public function testInvalidDatasetDimension() : void { $f = $this->getFactory(); $df = $this->getDataFactory(); @@ -140,7 +140,7 @@ public function test_invalid_dataset_dimension() : void } */ - public function test_with_title(): void + public function testWithTitle(): void { $f = $this->getFactory(); @@ -156,7 +156,7 @@ public function test_with_title(): void $this->assertEquals("Alternative title for Horizontal Bar", $horizontal1->getTitle()); } - public function test_with_title_invisible(): void + public function testWithTitleInvisible(): void { $f = $this->getFactory(); @@ -172,7 +172,7 @@ public function test_with_title_invisible(): void $this->assertEquals(false, $horizontal1->isTitleVisible()); } - public function test_with_tooltips_invisible(): void + public function testWithTooltipsInvisible(): void { $f = $this->getFactory(); @@ -188,7 +188,7 @@ public function test_with_tooltips_invisible(): void $this->assertEquals(false, $horizontal1->isTooltipsVisible()); } - public function test_with_legend_invisible(): void + public function testWithLegendInvisible(): void { $f = $this->getFactory(); @@ -204,7 +204,7 @@ public function test_with_legend_invisible(): void $this->assertEquals(false, $horizontal1->isLegendVisible()); } - public function test_with_legend_position(): void + public function testWithLegendPosition(): void { $f = $this->getFactory(); @@ -220,7 +220,7 @@ public function test_with_legend_position(): void $this->assertEquals("left", $horizontal1->getLegendPosition()); } - public function test_with_invalid_legend_position(): void + public function testWithInvalidLegendPosition(): void { $f = $this->getFactory(); @@ -237,7 +237,7 @@ public function test_with_invalid_legend_position(): void $horizontal = $horizontal->withLegendPosition("middle"); } - public function test_with_dataset(): void + public function testWithDataset(): void { $f = $this->getFactory(); @@ -254,7 +254,7 @@ public function test_with_dataset(): void $this->assertEquals($e_dataset, $horizontal1->getDataset()); } - public function test_with_bar_configs(): void + public function testWithBarConfigs(): void { $f = $this->getFactory(); $df = $this->getDataFactory(); @@ -278,7 +278,7 @@ public function test_with_bar_configs(): void $this->assertEquals($bars, $horizontal1->getBarConfigs()); } - public function test_index_axis(): void + public function testIndexAxis(): void { $f = $this->getFactory(); $df = $this->getDataFactory(); @@ -300,7 +300,7 @@ public function test_index_axis(): void $this->assertEquals("x", $vertical->getIndexAxis()); } - public function test_render_horizontal(): void + public function testRenderHorizontal(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); @@ -333,7 +333,7 @@ public function test_render_horizontal(): void $this->assertHTMLEquals("
" . $expected_html . "
", "
" . $html . "
"); } - public function test_render_vertical(): void + public function testRenderVertical(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); diff --git a/tests/UI/Component/Chart/ChartScaleBarTest.php b/tests/UI/Component/Chart/ChartScaleBarTest.php index 215052cdb802..de9ff97ba237 100644 --- a/tests/UI/Component/Chart/ChartScaleBarTest.php +++ b/tests/UI/Component/Chart/ChartScaleBarTest.php @@ -1,7 +1,5 @@ getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\ScaleBar", $f->scaleBar(array("1" => false))); } - public function test_get_items(): void + public function testGetItems(): void { $f = $this->getFactory(); @@ -60,7 +60,7 @@ public function test_get_items(): void $this->assertEquals($c->getItems(), $items); } - public function test_render(): void + public function testRender(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Chart/ProgressMeter/ChartProgressMeterTest.php b/tests/UI/Component/Chart/ProgressMeter/ChartProgressMeterTest.php index dd875ae85b26..df31e62d1549 100644 --- a/tests/UI/Component/Chart/ProgressMeter/ChartProgressMeterTest.php +++ b/tests/UI/Component/Chart/ProgressMeter/ChartProgressMeterTest.php @@ -1,7 +1,5 @@ getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Factory", $progressmeter); } - public function test_get_instances(): void + public function testGetInstances(): void { $progressmeter = $this->getFactory(); @@ -55,7 +55,7 @@ public function test_get_instances(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $mini); } - public function test_get_values_of_standard(): void + public function testGetValuesOfStandard(): void { $f = $this->getFactory(); $standard = $f->standard(400, 250, 300, 200); @@ -69,7 +69,7 @@ public function test_get_values_of_standard(): void $this->assertEquals(50, $standard->getComparisonAsPercent()); } - public function test_get_values_of_fixedSize(): void + public function testGetValuesOfFixedSize(): void { $f = $this->getFactory(); $fixedSize = $f->fixedSize(400, 250, 300, 200); @@ -83,7 +83,7 @@ public function test_get_values_of_fixedSize(): void $this->assertEquals(50, $fixedSize->getComparisonAsPercent()); } - public function test_get_values_of_mini(): void + public function testGetValuesOfMini(): void { $f = $this->getFactory(); $mini = $f->mini(400, 250, 300); @@ -95,7 +95,7 @@ public function test_get_values_of_mini(): void $this->assertEquals(75, $mini->getRequiredAsPercent()); } - public function test_render_standard_two_bar(): void + public function testRenderStandardTwoBar(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); @@ -136,7 +136,7 @@ public function test_render_standard_two_bar(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_fixedSize_one_bar(): void + public function testRenderFixedSizeOneBar(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); @@ -173,7 +173,7 @@ public function test_render_fixedSize_one_bar(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_mini(): void + public function testRenderMini(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); diff --git a/tests/UI/Component/ComponentHelperTest.php b/tests/UI/Component/ComponentHelperTest.php index 6e4844e14729..704861047766 100644 --- a/tests/UI/Component/ComponentHelperTest.php +++ b/tests/UI/Component/ComponentHelperTest.php @@ -1,7 +1,5 @@ mock = new ComponentMock(); } - public function test_getCanonicalName(): void + public function testGetCanonicalName(): void { $c = new TestComponent("foo"); $this->assertEquals("Test Component Test", $c->getCanonicalName()); @@ -104,12 +104,12 @@ public function test_getCanonicalName(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_ok(): void + public function testCheckArgOk(): void { $this->mock->_checkArg("some_arg", true, "some message"); } - public function test_check_arg_not_ok(): void + public function testCheckArgNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': some message"); @@ -119,12 +119,12 @@ public function test_check_arg_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_string_arg_ok(): void + public function testCheckStringArgOk(): void { $this->mock->_checkStringArg("some_arg", "bar"); } - public function test_check_string_arg_not_ok(): void + public function testCheckStringArgNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected string, got integer '1'"); @@ -134,12 +134,12 @@ public function test_check_string_arg_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_bool_arg_ok(): void + public function testCheckBoolArgOk(): void { $this->mock->_checkBoolArg("some_arg", true); } - public function test_check_bool_arg_not_ok(): void + public function testCheckBoolArgNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected bool, got integer '1'"); @@ -149,12 +149,12 @@ public function test_check_bool_arg_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_instanceof_ok(): void + public function testCheckArgInstanceofOk(): void { $this->mock->_checkArgInstanceOf("some_arg", $this->mock, ComponentMock::class); } - public function test_check_arg_instanceof_not_ok(): void + public function testCheckArgInstanceofNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected ComponentMock, got ComponentHelperTest"); @@ -165,19 +165,19 @@ public function test_check_arg_instanceof_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_is_element_ok(): void + public function testCheckArgIsElementOk(): void { $this->mock->_checkArgIsElement("some_arg", "bar", array("foo", "bar"), "foobar"); } - public function test_check_string_arg_is_element_not_ok(): void + public function testCheckStringArgIsElementNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected foobar, got 'baz'"); $this->mock->_checkArgIsElement("some_arg", "baz", array("foo", "bar"), "foobar"); } - public function test_to_array_with_array(): void + public function testToArrayWithArray(): void { $foo = array("foo", "bar"); $res = $this->mock->_toArray($foo); @@ -185,7 +185,7 @@ public function test_to_array_with_array(): void $this->assertEquals($foo, $res); } - public function test_to_array_with_int(): void + public function testToArrayWithInt(): void { $foo = 1; $res = $this->mock->_toArray($foo); @@ -195,13 +195,13 @@ public function test_to_array_with_int(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_list_elements_ok(): void + public function testCheckArgListElementsOk(): void { $l = array(new Class1(), new Class1(), new Class1()); $this->mock->_checkArgListElements("some_arg", $l, array("Class1")); } - public function test_check_arg_list_elements_no_ok(): void + public function testCheckArgListElementsNoOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected Class1, got Class2"); @@ -212,13 +212,13 @@ public function test_check_arg_list_elements_no_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_list_elements_multi_class_ok(): void + public function testCheckArgListElementsMultiClassOk(): void { $l = array(new Class1(), new Class2(), new Class1()); $this->mock->_checkArgListElements("some_arg", $l, array("Class1", "Class2")); } - public function test_check_arg_list_elements_multi_class_not_ok(): void + public function testCheckArgListElementsMultiClassNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected Class1, Class2, got Class3"); @@ -229,13 +229,13 @@ public function test_check_arg_list_elements_multi_class_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_list_elements_string_or_int_ok(): void + public function testCheckArgListElementsStringOrIntOk(): void { $l = array(1, "foo"); $this->mock->_checkArgListElements("some_arg", $l, array("string", "int")); } - public function test_check_arg_list_elements_string_or_int_not_ok(): void + public function testCheckArgListElementsStringOrIntNotOk(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Argument 'some_arg': expected string, int, got Class1"); @@ -246,7 +246,7 @@ public function test_check_arg_list_elements_string_or_int_not_ok(): void /** * @doesNotPerformAssertions */ - public function test_check_arg_list_ok(): void + public function testCheckArgListOk(): void { $l = array("a" => 1, "b" => 2, "c" => 3); $this->mock->_checkArgList("some_arg", $l, function ($k, $v) { @@ -256,7 +256,7 @@ public function test_check_arg_list_ok(): void }); } - public function test_check_arg_list_not_ok_1(): void + public function testCheckArgListNotOk1(): void { $m = "expected keys of type string and integer values, got (4 => 3)"; $this->expectException(InvalidArgumentException::class); @@ -269,7 +269,7 @@ public function test_check_arg_list_not_ok_1(): void }); } - public function test_check_arg_list_not_ok_2(): void + public function testCheckArgListNotOk2(): void { $m = "expected keys of type string and integer values, got (c => d)"; $this->expectException(InvalidArgumentException::class); diff --git a/tests/UI/Component/Counter/CounterClientHtmlTest.php b/tests/UI/Component/Counter/CounterClientHtmlTest.php index cc39865ce053..c0098811b7ca 100644 --- a/tests/UI/Component/Counter/CounterClientHtmlTest.php +++ b/tests/UI/Component/Counter/CounterClientHtmlTest.php @@ -1,4 +1,5 @@ getCounterFactory(); @@ -46,9 +46,9 @@ public function test_implements_factory_interface(): void } /** - * @dataProvider number_provider + * @dataProvider getNumberProvider */ - public function test_status_counter(int $number): void + public function testStatusCounter(int $number): void { $f = $this->getCounterFactory(); @@ -60,9 +60,9 @@ public function test_status_counter(int $number): void } /** - * @dataProvider number_provider + * @dataProvider getNumberProvider */ - public function test_novelty_counter(int $number): void + public function testNoveltyCounter(int $number): void { $f = $this->getCounterFactory(); @@ -73,23 +73,23 @@ public function test_novelty_counter(int $number): void $this->assertEquals($number, $c->getNumber()); } - public function test_known_counters_only(): void + public function testKnownCountersOnly(): void { $this->expectException(InvalidArgumentException::class); new Counter("FOO", 1); } /** - * @dataProvider no_number_provider + * @dataProvider getNoNumberProvider */ - public function test_int_numbers_only($no_number): void + public function testIntNumbersOnly($no_number): void { $this->expectException(TypeError::class); $f = $this->getCounterFactory(); $f->status($no_number); } - public function number_provider(): array + public function getNumberProvider(): array { return [ [-13], @@ -99,7 +99,7 @@ public function number_provider(): array ]; } - public function no_number_provider(): array + public function getNoNumberProvider(): array { return [ ["foo"], @@ -115,9 +115,9 @@ public function no_number_provider(): array ]; /** - * @dataProvider counter_type_and_number_provider + * @dataProvider getCounterTypeAndNumberProvider */ - public function test_render_status(string $type, int $number): void + public function testRenderStatus(string $type, int $number): void { $f = $this->getCounterFactory(); $r = $this->getDefaultRenderer(); @@ -130,7 +130,7 @@ public function test_render_status(string $type, int $number): void $this->assertHTMLEquals($expected, $html); } - public function counter_type_and_number_provider(): array + public function getCounterTypeAndNumberProvider(): array { return [ ["status", 42], diff --git a/tests/UI/Component/Deck/DeckTest.php b/tests/UI/Component/Deck/DeckTest.php index c9ecba305437..586d22f603d9 100644 --- a/tests/UI/Component/Deck/DeckTest.php +++ b/tests/UI/Component/Deck/DeckTest.php @@ -1,7 +1,5 @@ getFactory(); @@ -52,7 +52,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Deck\\Deck", $f->deck(array($c))); } - public function test_get_cards(): void + public function testGetCards(): void { $f = $this->getFactory(); $c = $f->card()->standard("Card Title"); @@ -61,7 +61,7 @@ public function test_get_cards(): void $this->assertEquals($d->getCards(), array($c)); } - public function test_with_cards(): void + public function testWithCards(): void { $f = $this->getFactory(); $c = $f->card()->standard("Card Title"); @@ -71,7 +71,7 @@ public function test_with_cards(): void $this->assertEquals($d->getCards(), array($c,$c)); } - public function test_get_size(): void + public function testGetSize(): void { $f = $this->getFactory(); @@ -81,7 +81,7 @@ public function test_get_size(): void $this->assertEquals(C\Deck\Deck::SIZE_S, $d->getCardsSize()); } - public function test_with_size(): void + public function testWithSize(): void { $f = $this->getFactory(); @@ -107,7 +107,7 @@ public function test_with_size(): void $this->assertEquals(C\Deck\Deck::SIZE_FULL, $d->getCardsSize()); } - public function test_render_content(): void + public function testRenderContent(): void { $r = $this->getDefaultRenderer(); $f = $this->getFactory(); diff --git a/tests/UI/Component/Divider/DividerTest.php b/tests/UI/Component/Divider/DividerTest.php index 2a3434262bc8..c2c4b8c2003b 100644 --- a/tests/UI/Component/Divider/DividerTest.php +++ b/tests/UI/Component/Divider/DividerTest.php @@ -1,7 +1,5 @@ getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Divider\\Horizontal", $f->horizontal()); } - public function test_with_label(): void + public function testWithLabel(): void { $f = $this->getFactory(); $c = $f->horizontal()->withLabel("label"); @@ -49,7 +49,7 @@ public function test_with_label(): void $this->assertEquals("label", $c->getLabel()); } - public function test_render_horizontal_empty(): void + public function testRenderHorizontalEmpty(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -63,7 +63,7 @@ public function test_render_horizontal_empty(): void $this->assertHTMLEquals($expected_html, $html); } - public function test_render_horizontal_with_label(): void + public function testRenderHorizontalWithLabel(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -76,7 +76,7 @@ public function test_render_horizontal_with_label(): void $this->assertHTMLEquals("
" . $expected_html . "
", "
" . $html . "
"); } - public function test_render_vertical(): void + public function testRenderVertical(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Dropdown/DropdownTest.php b/tests/UI/Component/Dropdown/DropdownTest.php index fb9957cb1e38..c6b7ed2237d5 100644 --- a/tests/UI/Component/Dropdown/DropdownTest.php +++ b/tests/UI/Component/Dropdown/DropdownTest.php @@ -1,7 +1,5 @@ getFactory(); $this->assertInstanceOf("ILIAS\\UI\\Component\\Dropdown\\Standard", $f->standard(array())); } - public function test_with_label(): void + public function testWithLabel(): void { $f = $this->getFactory(); @@ -50,7 +50,7 @@ public function test_with_label(): void $this->assertEquals("label", $c->getLabel()); } - public function test_with_items(): void + public function testWithItems(): void { $f = $this->getFactory(); $link = new I\Component\Link\Standard("Link to Github", "http://www.github.com"); @@ -68,7 +68,7 @@ public function test_with_items(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Link\\Standard", $items[3]); } - public function test_render_empty(): void + public function testRenderEmpty(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -81,7 +81,7 @@ public function test_render_empty(): void $this->assertEquals($expected, $html); } - public function test_render_items(): void + public function testRenderItems(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -110,7 +110,7 @@ public function test_render_items(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_items_with_label(): void + public function testRenderItemsWithLabel(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -136,7 +136,7 @@ public function test_render_items_with_label(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_with_link_new_viewport(): void + public function testRenderWithLinkNewViewport(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -160,7 +160,7 @@ public function test_render_with_link_new_viewport(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_items_with_aria_label(): void + public function testRenderItemsWithAriaLabel(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Entity/EntityTest.php b/tests/UI/Component/Entity/EntityTest.php index 4f267da938d1..a15b66189f0a 100644 --- a/tests/UI/Component/Entity/EntityTest.php +++ b/tests/UI/Component/Entity/EntityTest.php @@ -1,4 +1,5 @@ assertEquals([$this->legacy('d')], $entity->withDetails($this->legacy('d'))->getDetails()); } - public function EntityAllowedIdentiferTypes(): array + public function getEntityAllowedIdentiferTypes(): array { $shy_button = new Button\Shy('the label', '#'); $shy_link = new Link\Standard('the label', '#'); - $image = new Image\Image(Image\Image::STANDARD, 'source', 'alt'); - $icon = new Symbol\Icon\Standard('crs', 'label', 'large', false); + $image = new Image\Image(I\Image\Image::STANDARD, 'source', 'alt'); + $icon = new Symbol\Icon\Standard('crs', 'label', 'large', false); return [ [$shy_button], [$shy_link], @@ -75,7 +76,7 @@ public function EntityAllowedIdentiferTypes(): array } /** - * @dataProvider EntityAllowedIdentiferTypes + * @dataProvider getEntityAllowedIdentiferTypes */ public function testEntityIdentifiers($identifier): void { diff --git a/tests/UI/Component/HasHelpTopicsTest.php b/tests/UI/Component/HasHelpTopicsTest.php index da4aadf2a8fe..976c077db362 100644 --- a/tests/UI/Component/HasHelpTopicsTest.php +++ b/tests/UI/Component/HasHelpTopicsTest.php @@ -1,7 +1,5 @@ getImageFactory(); @@ -48,7 +48,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Image\\Image", $f->responsive("source", "alt")); } - public function test_get_type(): void + public function testGetType(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -56,7 +56,7 @@ public function test_get_type(): void $this->assertEquals($i::STANDARD, $i->getType()); } - public function test_get_source(): void + public function testGetSource(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -64,7 +64,7 @@ public function test_get_source(): void $this->assertEquals("source", $i->getSource()); } - public function test_get_alt(): void + public function testGetAlt(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -72,7 +72,7 @@ public function test_get_alt(): void $this->assertEquals("alt", $i->getAlt()); } - public function test_set_source(): void + public function testSetSource(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -80,7 +80,7 @@ public function test_set_source(): void $this->assertEquals("newSource", $i->getSource()); } - public function test_set_alt(): void + public function testSetAlt(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -88,7 +88,7 @@ public function test_set_alt(): void $this->assertEquals("newAlt", $i->getAlt()); } - public function test_set_string_action(): void + public function testSetStringAction(): void { $f = $this->getImageFactory(); $i = $f->standard("source", "alt"); @@ -96,7 +96,7 @@ public function test_set_string_action(): void $this->assertEquals("newAction", $i->getAction()); } - public function test_set_signal_action(): void + public function testSetSignalAction(): void { $f = $this->getImageFactory(); $signal = $this->createMock(C\Signal::class); @@ -105,21 +105,21 @@ public function test_set_signal_action(): void $this->assertEquals([$signal], $i->getAction()); } - public function test_invalid_source(): void + public function testInvalidSource(): void { $this->expectException(TypeError::class); $f = $this->getImageFactory(); $f->standard(1, "alt"); } - public function test_invalid_alt(): void + public function testInvalidAlt(): void { $this->expectException(TypeError::class); $f = $this->getImageFactory(); $f->standard("source", 1); } - public function test_render_standard(): void + public function testRenderStandard(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -132,7 +132,7 @@ public function test_render_standard(): void $this->assertEquals($expected, $html); } - public function test_render_responsive(): void + public function testRenderResponsive(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -145,7 +145,7 @@ public function test_render_responsive(): void $this->assertEquals($expected, $html); } - public function test_render_alt_escaping(): void + public function testRenderAltEscaping(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -158,7 +158,7 @@ public function test_render_alt_escaping(): void $this->assertEquals($expected, $html); } - public function test_render_with_string_action(): void + public function testRenderWithStringAction(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -171,7 +171,7 @@ public function test_render_with_string_action(): void $this->assertEquals($expected, $html); } - public function test_render_with_signal_action(): void + public function testRenderWithSignalAction(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -186,7 +186,7 @@ public function test_render_with_signal_action(): void $this->assertEquals($expected, $html); } - public function test_with_empty_action_and_no_additional_on_load_code(): void + public function testWithEmptyActionAndNoAdditionalOnLoadCode(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); @@ -200,7 +200,7 @@ public function test_with_empty_action_and_no_additional_on_load_code(): void $this->assertEquals($expected, $html); } - public function test_with_additional_on_load_code(): void + public function testWithAdditionalOnLoadCode(): void { $f = $this->getImageFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Input/ArrayInputDataTest.php b/tests/UI/Component/Input/ArrayInputDataTest.php index a299a8036e1f..2edc189cc53f 100644 --- a/tests/UI/Component/Input/ArrayInputDataTest.php +++ b/tests/UI/Component/Input/ArrayInputDataTest.php @@ -1,7 +1,5 @@ buildFactory(); diff --git a/tests/UI/Component/Input/Container/Filter/FilterTest.php b/tests/UI/Component/Input/Container/Filter/FilterTest.php index 5e1104e8c082..22110d53acbc 100644 --- a/tests/UI/Component/Input/Container/Filter/FilterTest.php +++ b/tests/UI/Component/Input/Container/Filter/FilterTest.php @@ -1,7 +1,5 @@ buildFactory(); $if = $this->buildInputFactory(); @@ -215,7 +215,7 @@ public function test_getInputs(): void } } - public function test_extractParamData(): void + public function testExtractParamData(): void { $filter = new ConcreteFilter( new SignalGenerator(), @@ -240,7 +240,7 @@ public function test_extractParamData(): void $this->assertInstanceOf(InputData::class, $input_data); } - public function test_withRequest(): void + public function testWithRequest(): void { $request = $this->createMock(ServerRequestInterface::class); $input_data = $this->createMock(InputData::class); @@ -293,7 +293,7 @@ public function test_withRequest(): void $this->assertEquals([$input_1, $input_2], $filter2->getInputs()); } - public function test_getData(): void + public function testGetData(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -341,7 +341,7 @@ public function test_getData(): void $this->assertEquals([1, 2], $filter->getData()); } - public function test_with_activated(): void + public function testWithActivated(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -366,7 +366,7 @@ public function test_with_activated(): void $this->assertTrue($filter1->isActivated()); } - public function test_with_deactivated(): void + public function testWithDeactivated(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -391,7 +391,7 @@ public function test_with_deactivated(): void $this->assertFalse($filter1->isActivated()); } - public function test_with_expanded(): void + public function testWithExpanded(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -416,7 +416,7 @@ public function test_with_expanded(): void $this->assertTrue($filter1->isExpanded()); } - public function test_with_collapsed(): void + public function testWithCollapsed(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); diff --git a/tests/UI/Component/Input/Container/Filter/StandardFilterTest.php b/tests/UI/Component/Input/Container/Filter/StandardFilterTest.php index f552e7c7da46..35fea7202687 100644 --- a/tests/UI/Component/Input/Container/Filter/StandardFilterTest.php +++ b/tests/UI/Component/Input/Container/Filter/StandardFilterTest.php @@ -15,6 +15,7 @@ * https://github.com/ILIAS-eLearning * *********************************************************************/ + declare(strict_types=1); require_once(__DIR__ . "/../../../../../../libs/composer/vendor/autoload.php"); @@ -139,7 +140,7 @@ public function getUIFactory(): WithNoUIFactories ); } - public function test_render_activated_collapsed(): void + public function testRenderActivatedCollapsed(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -273,7 +274,7 @@ public function test_render_activated_collapsed(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html)); } - public function test_render_deactivated_collapsed(): void + public function testRenderDeactivatedCollapsed(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -407,7 +408,7 @@ public function test_render_deactivated_collapsed(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html)); } - public function test_render_activated_expanded(): void + public function testRenderActivatedExpanded(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -541,7 +542,7 @@ public function test_render_activated_expanded(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html)); } - public function test_render_deactivated_expanded(): void + public function testRenderDeactivatedExpanded(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -675,7 +676,7 @@ public function test_render_deactivated_expanded(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html)); } - public function test_dedicated_names(): void + public function testDedicatedNames(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); diff --git a/tests/UI/Component/Input/Container/Form/FormFactoryTest.php b/tests/UI/Component/Input/Container/Form/FormFactoryTest.php index 44d7ab8bece9..7994ccf0b7f2 100644 --- a/tests/UI/Component/Input/Container/Form/FormFactoryTest.php +++ b/tests/UI/Component/Input/Container/Form/FormFactoryTest.php @@ -1,7 +1,5 @@ buildFactory(); diff --git a/tests/UI/Component/Input/Container/Form/FormTest.php b/tests/UI/Component/Input/Container/Form/FormTest.php index 32c042deead5..7d3cae07373b 100644 --- a/tests/UI/Component/Input/Container/Form/FormTest.php +++ b/tests/UI/Component/Input/Container/Form/FormTest.php @@ -1,4 +1,5 @@ buildFactory(); $if = $this->buildInputFactory(); @@ -161,7 +162,7 @@ public function test_getInputs(): void } } - public function test_extractPostData(): void + public function testExtractPostData(): void { $form = new ConcreteForm($this->buildInputFactory(), new DefNamesource(), []); $request = $this->createMock(ServerRequestInterface::class); @@ -173,7 +174,7 @@ public function test_extractPostData(): void $this->assertInstanceOf(InputData::class, $input_data); } - public function test_withRequest(): void + public function testWithRequest(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -212,7 +213,7 @@ public function test_withRequest(): void $this->assertEquals([$input_1, $input_2], $form2->getInputs()); } - public function test_withRequest_respects_keys(): void + public function testWithRequestRespectsKeys(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -251,7 +252,7 @@ public function test_withRequest_respects_keys(): void $this->assertEquals(["foo" => $input_1, "bar" => $input_2], $form2->getInputs()); } - public function test_getData(): void + public function testGetData(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -286,7 +287,7 @@ public function test_getData(): void $this->assertEquals([1, 2], $form->getData()); } - public function test_getData_respects_keys(): void + public function testGetDataRespectsKeys(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -321,7 +322,7 @@ public function test_getData_respects_keys(): void $this->assertEquals(["foo" => 1, "bar" => 2], $form->getData()); } - public function test_getData_faulty(): void + public function testGetDataFaulty(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -365,7 +366,7 @@ public function test_getData_faulty(): void $this->assertEquals(null, null); } - public function test_withAdditionalTransformation(): void + public function testWithAdditionalTransformation(): void { $df = $this->buildDataFactory(); $request = $this->createMock(ServerRequestInterface::class); @@ -407,7 +408,7 @@ public function test_withAdditionalTransformation(): void $this->assertEquals("transformed", $form2->getData()); } - public function test_nameInputs_respects_keys(): void + public function testNameInputsRespectsKeys(): void { $if = $this->buildInputFactory(); $inputs = [ diff --git a/tests/UI/Component/Input/Container/Form/NoSubmitFormTest.php b/tests/UI/Component/Input/Container/Form/NoSubmitFormTest.php index a24f03cea73a..d90c2439ea59 100644 --- a/tests/UI/Component/Input/Container/Form/NoSubmitFormTest.php +++ b/tests/UI/Component/Input/Container/Form/NoSubmitFormTest.php @@ -73,7 +73,7 @@ public function setUp(): void parent::setUp(); } - public function test_render(): void + public function testRender(): void { $post_url = 'http://ilias.localhost/some_url?param1=foo¶m2=bar'; @@ -100,7 +100,7 @@ public function test_render(): void ); } - public function test_render_with_required_inputs(): void + public function testRenderWithRequiredInputs(): void { $post_url = 'http://ilias.localhost/some_url?param1=foo¶m2=bar'; $required_lang_var = 'required_field'; @@ -129,7 +129,7 @@ public function test_render_with_required_inputs(): void ); } - public function test_render_with_error(): void + public function testRenderWithError(): void { $post_url = 'http://ilias.localhost/some_url?param1=foo¶m2=bar'; $error_lang_var = 'ui_error_in_group'; diff --git a/tests/UI/Component/Input/Container/Form/PostDataFromServerRequestTest.php b/tests/UI/Component/Input/Container/Form/PostDataFromServerRequestTest.php index 3a20746fd9a2..109a8805c2be 100644 --- a/tests/UI/Component/Input/Container/Form/PostDataFromServerRequestTest.php +++ b/tests/UI/Component/Input/Container/Form/PostDataFromServerRequestTest.php @@ -1,7 +1,5 @@ post_data = new PostDataFromServerRequest($request); } - public function test_get_success(): void + public function testGetSuccess(): void { $this->assertEquals("bar", $this->post_data->get("foo")); } - public function test_get_fail(): void + public function testGetFail(): void { $raised = false; try { @@ -51,12 +51,12 @@ public function test_get_fail(): void $this->assertTrue($raised, "Logic exception was raised."); } - public function test_getOr_match(): void + public function testGetOrMatch(): void { $this->assertEquals("bar", $this->post_data->getOr("foo", "baz")); } - public function test_getOr_no_match(): void + public function testGetOrNoMatch(): void { $this->assertEquals("blaw", $this->post_data->getOr("baz", "blaw")); } diff --git a/tests/UI/Component/Input/Container/Form/StandardFormTest.php b/tests/UI/Component/Input/Container/Form/StandardFormTest.php index f335343b6cd2..d600c14ef4e8 100644 --- a/tests/UI/Component/Input/Container/Form/StandardFormTest.php +++ b/tests/UI/Component/Input/Container/Form/StandardFormTest.php @@ -99,7 +99,7 @@ public function getUIFactory(): WithButtonNoUIFactory return new WithButtonNoUIFactory($this->buildButtonFactory()); } - public function test_getPostURL(): void + public function testGetPostURL(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -108,7 +108,7 @@ public function test_getPostURL(): void $this->assertEquals($url, $form->getPostURL()); } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -141,7 +141,7 @@ public function test_render(): void $this->assertHTMLEquals($expected, $html); } - public function test_submit_caption(): void + public function testSubmitCaption(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -159,7 +159,7 @@ public function test_submit_caption(): void $this->assertEquals($caption, $form->getSubmitLabel()); } - public function test_submit_caption_render(): void + public function testSubmitCaptionRender(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); @@ -192,7 +192,7 @@ public function test_submit_caption_render(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_no_url(): void + public function testRenderNoUrl(): void { $f = $this->buildFactory(); $if = $this->buildInputFactory(); diff --git a/tests/UI/Component/Input/DynamicInputDataIteratorTest.php b/tests/UI/Component/Input/DynamicInputDataIteratorTest.php index c5555014480c..94b7c17f2b1d 100644 --- a/tests/UI/Component/Input/DynamicInputDataIteratorTest.php +++ b/tests/UI/Component/Input/DynamicInputDataIteratorTest.php @@ -1,7 +1,5 @@ buildFactory(); $cp = $f->colorpicker("label", "byline"); @@ -60,7 +60,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\ColorPicker::class, $cp); } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -82,7 +82,7 @@ public function test_render(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; @@ -107,7 +107,7 @@ public function test_render_disabled(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_required(): void + public function testRenderRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -133,7 +133,7 @@ public function test_render_required(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_value(): void + public function testRenderValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -158,7 +158,7 @@ public function test_render_value(): void $this->assertHTMLEquals($expected, $html); } - public function test_value_required(): void + public function testValueRequired(): void { $f = $this->buildFactory(); $label = "label"; diff --git a/tests/UI/Component/Input/Field/DateTimeInputTest.php b/tests/UI/Component/Input/Field/DateTimeInputTest.php index c80752160f03..e98f67a31aa2 100644 --- a/tests/UI/Component/Input/Field/DateTimeInputTest.php +++ b/tests/UI/Component/Input/Field/DateTimeInputTest.php @@ -1,7 +1,5 @@ data_factory->dateFormat()->germanShort(); $datetime = $this->factory->datetime('label', 'byline') @@ -91,7 +91,7 @@ public function test_withFormat(): void ); } - public function test_withMinValue(): void + public function testWithMinValue(): void { $dat = new DateTimeImmutable('2019-01-09'); $datetime = $this->factory->datetime('label', 'byline') @@ -103,7 +103,7 @@ public function test_withMinValue(): void ); } - public function test_withMaxValue(): void + public function testWithMaxValue(): void { $dat = new DateTimeImmutable('2019-01-09'); $datetime = $this->factory->datetime('label', 'byline') @@ -115,21 +115,21 @@ public function test_withMaxValue(): void ); } - public function test_withUseTime(): void + public function testWithUseTime(): void { $datetime = $this->factory->datetime('label', 'byline'); $this->assertFalse($datetime->getUseTime()); $this->assertTrue($datetime->withUseTime(true)->getUseTime()); } - public function test_withTimeOnly(): void + public function testWithTimeOnly(): void { $datetime = $this->factory->datetime('label', 'byline'); $this->assertFalse($datetime->getTimeOnly()); $this->assertTrue($datetime->withTimeOnly(true)->getTimeOnly()); } - public function test_withTimeZone(): void + public function testWithTimeZone(): void { $datetime = $this->factory->datetime('label', 'byline'); $this->assertNull($datetime->getTimeZone()); @@ -140,7 +140,7 @@ public function test_withTimeZone(): void ); } - public function test_withInvalidTimeZone(): void + public function testWithInvalidTimeZone(): void { $this->expectException(InvalidArgumentException::class); $datetime = $this->factory->datetime('label', 'byline'); @@ -148,7 +148,7 @@ public function test_withInvalidTimeZone(): void $datetime->withTimeZone($tz); } - public function test_jsConfigRendering(): void + public function testJsConfigRendering(): void { $datetime = $this->factory->datetime('label', 'byline'); $js_binding = $this->getJavaScriptBinding(); @@ -165,7 +165,7 @@ public function test_jsConfigRendering(): void $this->assertEquals($expected, $onload_js); } - public function test_withValueThatIsDateTimeImmutable(): void + public function testWithValueThatIsDateTimeImmutable(): void { $string_value = "1985-05-04"; $value = new \DateTimeImmutable($string_value); diff --git a/tests/UI/Component/Input/Field/DurationInputTest.php b/tests/UI/Component/Input/Field/DurationInputTest.php index e756e2c35f61..fe4f0a9e7f91 100644 --- a/tests/UI/Component/Input/Field/DurationInputTest.php +++ b/tests/UI/Component/Input/Field/DurationInputTest.php @@ -1,7 +1,5 @@ data_factory->dateFormat()->germanShort(); $duration = $this->factory->duration('label', 'byline') @@ -93,7 +93,7 @@ public function test_withFormat(): void ); } - public function test_withMinValue(): void + public function testWithMinValue(): void { $dat = new DateTimeImmutable('2019-01-09'); $duration = $this->factory->duration('label', 'byline') @@ -105,7 +105,7 @@ public function test_withMinValue(): void ); } - public function test_withMaxValue(): void + public function testWithMaxValue(): void { $dat = new DateTimeImmutable('2019-01-09'); $duration = $this->factory->duration('label', 'byline') @@ -117,21 +117,21 @@ public function test_withMaxValue(): void ); } - public function test_withUseTime(): void + public function testWithUseTime(): void { $datetime = $this->factory->duration('label', 'byline'); $this->assertFalse($datetime->getUseTime()); $this->assertTrue($datetime->withUseTime(true)->getUseTime()); } - public function test_withTimeOnly(): void + public function testWithTimeOnly(): void { $datetime = $this->factory->duration('label', 'byline'); $this->assertFalse($datetime->getTimeOnly()); $this->assertTrue($datetime->withTimeOnly(true)->getTimeOnly()); } - public function test_withTimeZone(): void + public function testWithTimeZone(): void { $datetime = $this->factory->duration('label', 'byline'); $this->assertNull($datetime->getTimeZone()); @@ -142,7 +142,7 @@ public function test_withTimeZone(): void ); } - public function test_withInvalidTimeZone(): void + public function testWithInvalidTimeZone(): void { $this->expectException(InvalidArgumentException::class); $datetime = $this->factory->duration('label', 'byline'); @@ -156,7 +156,7 @@ public function testWithoutByline(): void $this->assertInstanceOf(C\Input\Field\Duration::class, $datetime); } - public function test_render(): \ILIAS\UI\Component\Input\Field\Duration + public function testRender(): \ILIAS\UI\Component\Input\Field\Duration { $datetime = $this->factory->duration('label', 'byline'); $r = $this->getDefaultRenderer(); @@ -193,9 +193,9 @@ public function test_render(): \ILIAS\UI\Component\Input\Field\Duration } /** - * @depends test_render + * @depends testRender */ - public function testRenderwithDifferentLabels($datetime): void + public function testRenderWithDifferentLabels($datetime): void { $other_start_label = 'other startlabel'; $other_end_label = 'other endlabel'; diff --git a/tests/UI/Component/Input/Field/FieldFactoryTest.php b/tests/UI/Component/Input/Field/FieldFactoryTest.php index f01bfe9e5332..b511b847907b 100644 --- a/tests/UI/Component/Input/Field/FieldFactoryTest.php +++ b/tests/UI/Component/Input/Field/FieldFactoryTest.php @@ -1,7 +1,5 @@ assertInstanceOf(Field\Group::class, $input); } - public function test_implements_factory_no_by_line(): void + public function testImplementsFactoryNoByLine(): void { $f = $this->buildFactory(); diff --git a/tests/UI/Component/Input/Field/FileInputTest.php b/tests/UI/Component/Input/Field/FileInputTest.php index b9de084998df..3ba8379dce0c 100644 --- a/tests/UI/Component/Input/Field/FileInputTest.php +++ b/tests/UI/Component/Input/Field/FileInputTest.php @@ -140,7 +140,7 @@ public function supportsChunkedUploads(): bool } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $f = $this->buildFactory(); @@ -151,7 +151,7 @@ public function test_implements_factory_interface(): void } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -180,7 +180,7 @@ public function test_render(): void } - public function test_render_error(): void + public function testRenderError(): void { $f = $this->buildFactory(); $label = "label"; @@ -209,7 +209,7 @@ public function test_render_error(): void } - public function test_render_no_byline(): void + public function testRenderNoByline(): void { $f = $this->buildFactory(); $label = "label"; @@ -234,7 +234,7 @@ public function test_render_no_byline(): void } - public function test_render_value(): void + public function testRenderValue(): void { $test_file_id = "test_file_id_1"; $test_file_name = "test file name 1"; @@ -292,7 +292,7 @@ public function test_render_value(): void } - public function test_render_with_metadata(): void + public function testRenderWithMetadata(): void { $factory = $this->buildFactory(); @@ -366,7 +366,7 @@ public function test_render_with_metadata(): void } - public function test_render_with_metadata_value(): void + public function testRenderWithMetadataValue(): void { $test_file_id = "test_file_id_1"; $test_file_name = "test file name 1"; @@ -448,7 +448,7 @@ public function test_render_with_metadata_value(): void } - public function test_render_required(): void + public function testRenderRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -473,7 +473,7 @@ public function test_render_required(): void } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; diff --git a/tests/UI/Component/Input/Field/GroupInputTest.php b/tests/UI/Component/Input/Field/GroupInputTest.php index fecac9e73517..20e50ea2c9b4 100644 --- a/tests/UI/Component/Input/Field/GroupInputTest.php +++ b/tests/UI/Component/Input/Field/GroupInputTest.php @@ -1,4 +1,5 @@ input->withNameFrom($this->name_source); @@ -56,7 +56,7 @@ public function test_render(): void $this->assertEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $input = $this->input->withNameFrom($this->name_source); $input = $input->withDisabled(true); @@ -70,7 +70,7 @@ public function test_render_disabled(): void $this->assertEquals($expected, $html); } - public function test_render_value(): void + public function testRenderValue(): void { $input = $this->input->withNameFrom($this->name_source); $input = $input->withValue('some_value'); diff --git a/tests/UI/Component/Input/Field/InputTest.php b/tests/UI/Component/Input/Field/InputTest.php index 379a7088c121..27fb77fb04e4 100644 --- a/tests/UI/Component/Input/Field/InputTest.php +++ b/tests/UI/Component/Input/Field/InputTest.php @@ -15,6 +15,7 @@ * https://github.com/ILIAS-eLearning * *********************************************************************/ + declare(strict_types=1); require_once(__DIR__ . "/../../../../../libs/composer/vendor/autoload.php"); @@ -138,13 +139,13 @@ public function setUp(): void $this->name_source = new DefNamesource(); } - public function test_constructor(): void + public function testConstructor(): void { $this->assertEquals("label", $this->input->getLabel()); $this->assertEquals("byline", $this->input->getByline()); } - public function test_withLabel(): void + public function testWithLabel(): void { $label = "new label"; $input = $this->input->withLabel($label); @@ -152,7 +153,7 @@ public function test_withLabel(): void $this->assertNotSame($this->input, $input); } - public function test_withByline(): void + public function testWithByline(): void { $byline = "new byline"; $input = $this->input->withByline($byline); @@ -160,7 +161,7 @@ public function test_withByline(): void $this->assertNotSame($this->input, $input); } - public function test_withRequired(): void + public function testWithRequired(): void { $this->assertFalse($this->input->isRequired()); $input = $this->input->withRequired(true); @@ -169,7 +170,7 @@ public function test_withRequired(): void $this->assertFalse($input->isRequired()); } - public function test_withRequired_and_custom_constraint(): void + public function testWithRequiredAndCustomConstraint(): void { $custom_constraint = $this->refinery->custom()->constraint( function ($value) { @@ -182,7 +183,7 @@ function ($value) { $this->assertEquals($input->requirement_constraint, $custom_constraint); } - public function test_withDisabled(): void + public function testWithDisabled(): void { $this->assertFalse($this->input->isDisabled()); $input = $this->input->withDisabled(true); @@ -191,7 +192,7 @@ public function test_withDisabled(): void $this->assertFalse($input->isDisabled()); } - public function test_withValue(): void + public function testWithValue(): void { $value = "some value"; $input = $this->input->withValue($value); @@ -200,7 +201,7 @@ public function test_withValue(): void $this->assertNotSame($this->input, $input); } - public function test_withValue_throws(): void + public function testWithValueThrows(): void { $this->input->value_ok = false; $raised = false; @@ -214,7 +215,7 @@ public function test_withValue_throws(): void $this->assertEquals(null, $this->input->getValue()); } - public function test_withName(): void + public function testWithName(): void { $name = "name_0"; $input = $this->input->withNameFrom($this->name_source); @@ -224,7 +225,7 @@ public function test_withName(): void $this->assertEquals(1, $this->name_source->count); } - public function test_withNameForNamedInput(): void + public function testWithNameForNamedInput(): void { $name = "dedicated_name_0"; $input = $this->named_input->withNameFrom($this->name_source); @@ -234,7 +235,7 @@ public function test_withNameForNamedInput(): void $this->assertEquals(1, $this->name_source->count); } - public function test_withError(): void + public function testWithError(): void { $error = "error"; $input = $this->input->withError($error); @@ -243,14 +244,14 @@ public function test_withError(): void $this->assertNotSame($this->input, $input); } - public function test_getContent(): void + public function testGetContent(): void { $this->expectException(LogicException::class); $this->input->getContent(); } - public function test_withInput(): void + public function testWithInput(): void { $name = "name_0"; $value = "valu"; @@ -268,7 +269,7 @@ public function test_withInput(): void $this->assertEquals($value, $input2->getValue()); } - public function test_only_run_withInput_with_name(): void + public function testOnlyRunWithInputWithName(): void { $raised = false; try { @@ -280,7 +281,7 @@ public function test_only_run_withInput_with_name(): void $this->assertTrue($raised); } - public function test_withInput_and_transformation(): void + public function testWithInputAndTransformation(): void { $name = "name_0"; $value = "value"; @@ -305,7 +306,7 @@ public function test_withInput_and_transformation(): void $this->assertEquals($value, $input2->getValue()); } - public function test_withInput_and_transformation_different_order(): void + public function testWithInputAndTransformationDifferentOrder(): void { $name = "name_0"; $value = "value"; @@ -330,7 +331,7 @@ public function test_withInput_and_transformation_different_order(): void $this->assertEquals($value, $input2->getValue()); } - public function test_withInput_and_constraint_successfull(): void + public function testWithInputAndConstraintSuccessfull(): void { $name = "name_0"; $value = "value"; @@ -352,7 +353,7 @@ public function test_withInput_and_constraint_successfull(): void $this->assertEquals(null, $input2->getError()); } - public function test_withInput_and_constraint_fails(): void + public function testWithInputAndConstraintFails(): void { $name = "name_0"; $value = "value"; @@ -374,7 +375,7 @@ public function test_withInput_and_constraint_fails(): void $this->assertEquals($error, $input2->getError()); } - public function test_withInput_and_constraint_fails_different_order(): void + public function testWithInputAndConstraintFailsDifferentOrder(): void { $rc = $this->refinery->custom(); @@ -401,7 +402,7 @@ public function test_withInput_and_constraint_fails_different_order(): void $this->assertEquals($error, $input2->getError()); } - public function test_withInput_transformation_and_constraint(): void + public function testWithInputTransformationAndConstraint(): void { $name = "name_0"; $value = "value"; @@ -433,7 +434,7 @@ public function test_withInput_transformation_and_constraint(): void $this->assertEquals(null, $input2->getError()); } - public function test_withInput_transformation_and_constraint_different_order(): void + public function testWithInputTransformationAndConstraintDifferentOrder(): void { $name = "name_0"; $value = "value"; @@ -465,7 +466,7 @@ public function test_withInput_transformation_and_constraint_different_order(): $this->assertEquals(null, $input2->getError()); } - public function test_withInput_constraint_and_transformation(): void + public function testWithInputConstraintAndTransformation(): void { $name = "name_0"; $value = "value"; @@ -497,7 +498,7 @@ public function test_withInput_constraint_and_transformation(): void $this->assertEquals(null, $input2->getError()); } - public function test_withInput_constraint_fails_and_transformation(): void + public function testWithInputConstraintFailsAndTransformation(): void { $rc = $this->refinery->custom(); @@ -530,7 +531,7 @@ public function test_withInput_constraint_fails_and_transformation(): void $this->assertEquals($error, $input2->getError()); } - public function test_withInput_constraint_fails_and_transformation_different_order(): void + public function testWithInputConstraintFailsAndTransformationDifferentOrder(): void { $name = "name_0"; $value = "value"; @@ -562,7 +563,7 @@ public function test_withInput_constraint_fails_and_transformation_different_ord $this->assertEquals($error, $input2->getError()); } - public function test_withInput_requirement_constraint(): void + public function testWithInputRequirementConstraint(): void { $name = "name_0"; $value = "Adam"; @@ -582,7 +583,7 @@ function ($value) { $this->assertEquals($error, $input2->getError()); } - public function test_withInput_toggle_requirement(): void + public function testWithInputToggleRequirement(): void { $name = "name_0"; $value = "value"; diff --git a/tests/UI/Component/Input/Field/LinkInputTest.php b/tests/UI/Component/Input/Field/LinkInputTest.php index 9491af5cb3be..d820799f7903 100644 --- a/tests/UI/Component/Input/Field/LinkInputTest.php +++ b/tests/UI/Component/Input/Field/LinkInputTest.php @@ -1,7 +1,5 @@ buildFactory(); $url = $factory->link("Test Label", "Test Byline"); @@ -62,7 +62,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Link::class, $url); } - public function test_rendering(): void + public function testRendering(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -91,7 +91,7 @@ public function test_rendering(): void ); } - public function test_produces_null_when_no_data_exists(): void + public function testProducesNullWhenNoDataExists(): void { $f = $this->buildFactory(); $input = $f->link("", "") diff --git a/tests/UI/Component/Input/Field/MarkdownTest.php b/tests/UI/Component/Input/Field/MarkdownTest.php index c670a89e5f4f..614f3a288a6a 100644 --- a/tests/UI/Component/Input/Field/MarkdownTest.php +++ b/tests/UI/Component/Input/Field/MarkdownTest.php @@ -121,7 +121,7 @@ public function symbol(): SymbolFactory }; } - public function test_render(): void + public function testRender(): void { $label = 'test_label'; @@ -172,7 +172,7 @@ public function test_render(): void $this->assertEquals($expected, $html); } - public function test_render_with_byline(): void + public function testRenderWithByline(): void { $label = 'test_label'; $byline = 'test_byline'; @@ -229,7 +229,7 @@ public function test_render_with_byline(): void $this->assertEquals($expected, $html); } - public function test_render_with_limits(): void + public function testRenderWithLimits(): void { $label = 'test_label'; $byline = 'test_byline'; @@ -289,7 +289,7 @@ public function test_render_with_limits(): void $this->assertEquals($expected, $html); } - public function test_render_with_disabled(): void + public function testRenderWithDisabled(): void { $label = 'test_label'; $byline = 'test_byline'; @@ -346,7 +346,7 @@ public function test_render_with_disabled(): void $this->assertEquals($expected, $html); } - public function test_render_with_required(): void + public function testRenderWithRequired(): void { $label = 'test_label'; $byline = 'test_byline'; @@ -403,7 +403,7 @@ public function test_render_with_required(): void $this->assertEquals($expected, $html); } - public function test_render_with_error(): void + public function testRenderWithError(): void { $label = 'test_label'; $byline = 'test_byline'; diff --git a/tests/UI/Component/Input/Field/MultiSelectInputTest.php b/tests/UI/Component/Input/Field/MultiSelectInputTest.php index 10c3ed6946f4..7af64525a9ab 100644 --- a/tests/UI/Component/Input/Field/MultiSelectInputTest.php +++ b/tests/UI/Component/Input/Field/MultiSelectInputTest.php @@ -1,7 +1,5 @@ buildFactory(); $options = array( @@ -63,7 +63,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\MultiSelect::class, $ms); } - public function test_options(): void + public function testOptions(): void { $f = $this->buildFactory(); $options = array( @@ -74,7 +74,7 @@ public function test_options(): void $this->assertEquals($options, $ms->getOptions()); } - public function test_only_accepts_actual_options_from_client_side(): void + public function testOnlyAcceptsActualOptionsFromClientSide(): void { $this->expectException(InvalidArgumentException::class); $f = $this->buildFactory(); @@ -104,7 +104,7 @@ public function get($_): void $ms->getContent(); } - public function test_render(): void + public function testRender(): void { $r = $this->getDefaultRenderer(); $f = $this->buildFactory(); @@ -140,7 +140,7 @@ public function test_render(): void $this->assertHTMLEquals($expected, $r->render($ms)); } - public function test_render_value(): void + public function testRenderValue(): void { $r = $this->getDefaultRenderer(); $f = $this->buildFactory(); @@ -186,7 +186,7 @@ public function test_render_value(): void $this->assertHTMLEquals($expected, $r->render($ms)); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $r = $this->getDefaultRenderer(); $f = $this->buildFactory(); diff --git a/tests/UI/Component/Input/Field/NumericInputTest.php b/tests/UI/Component/Input/Field/NumericInputTest.php index b5cda8952860..83b1af6f369a 100644 --- a/tests/UI/Component/Input/Field/NumericInputTest.php +++ b/tests/UI/Component/Input/Field/NumericInputTest.php @@ -1,7 +1,5 @@ buildFactory(); @@ -61,7 +61,7 @@ public function test_implements_factory_interface(): void } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -83,7 +83,7 @@ public function test_render(): void $this->assertEquals($expected, $html); } - public function test_render_error(): void + public function testRenderError(): void { $f = $this->buildFactory(); $label = "label"; @@ -106,7 +106,7 @@ public function test_render_error(): void $this->assertEquals($expected, $html); } - public function test_render_no_byline(): void + public function testRenderNoByline(): void { $f = $this->buildFactory(); $label = "label"; @@ -124,7 +124,7 @@ public function test_render_no_byline(): void $this->assertEquals($expected, $html); } - public function test_render_value(): void + public function testRenderValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -143,7 +143,7 @@ public function test_render_value(): void $this->assertEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; diff --git a/tests/UI/Component/Input/Field/OptionalGroupInputTest.php b/tests/UI/Component/Input/Field/OptionalGroupInputTest.php index 389ad8566fad..162b8bd52789 100644 --- a/tests/UI/Component/Input/Field/OptionalGroupInputTest.php +++ b/tests/UI/Component/Input/Field/OptionalGroupInputTest.php @@ -1,7 +1,5 @@ buildFactory(); $pwd = $f->password("label", "byline"); @@ -78,7 +79,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Password::class, $pwd); } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -100,7 +101,7 @@ public function test_render(): void $this->assertHTMLEquals($expected, $r->render($pwd)); } - public function test_render_error(): void + public function testRenderError(): void { $f = $this->buildFactory(); $label = "label"; @@ -123,7 +124,7 @@ public function test_render_error(): void $this->assertEquals($expected, $html); } - public function test_render_no_byline(): void + public function testRenderNoByline(): void { $f = $this->buildFactory(); $label = "label"; @@ -143,7 +144,7 @@ public function test_render_no_byline(): void $this->assertHTMLEquals($expected, $r->render($pwd)); } - public function test_render_value(): void + public function testRenderValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -164,7 +165,7 @@ public function test_render_value(): void $this->assertHTMLEquals($expected, $r->render($pwd)); } - public function test_render_required(): void + public function testRenderRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -186,7 +187,7 @@ public function test_render_required(): void $this->assertHTMLEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; @@ -208,7 +209,7 @@ public function test_render_disabled(): void $this->assertHTMLEquals($expected, $html); } - public function test_value_required(): void + public function testValueRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -224,7 +225,7 @@ public function test_value_required(): void $this->assertTrue($value2->isError()); } - public function test_value_type(): void + public function testValueType(): void { $f = $this->buildFactory(); $label = "label"; diff --git a/tests/UI/Component/Input/Field/RadioInputTest.php b/tests/UI/Component/Input/Field/RadioInputTest.php index bd983570f2e8..af683bb4a7ba 100644 --- a/tests/UI/Component/Input/Field/RadioInputTest.php +++ b/tests/UI/Component/Input/Field/RadioInputTest.php @@ -1,7 +1,5 @@ withNameFrom($this->name_source); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $f = $this->buildFactory(); $radio = $f->radio("label", "byline"); @@ -69,7 +69,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Radio::class, $radio); } - public function test_render(): void + public function testRender(): void { $r = $this->getDefaultRenderer(); $radio = $this->buildRadio(); @@ -101,7 +101,7 @@ public function test_render(): void $this->assertHTMLEquals($expected, $r->render($radio)); } - public function test_render_value(): void + public function testRenderValue(): void { $r = $this->getDefaultRenderer(); $radio = $this->buildRadio(); @@ -139,7 +139,7 @@ public function test_render_value(): void $this->assertHTMLEquals($expected, $r->render($radio)); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $r = $this->getDefaultRenderer(); $radio = $this->buildRadio()->withDisabled(true); diff --git a/tests/UI/Component/Input/Field/SectionInputTest.php b/tests/UI/Component/Input/Field/SectionInputTest.php index 1bd4ebfeaca5..1dfb7e861b9e 100644 --- a/tests/UI/Component/Input/Field/SectionInputTest.php +++ b/tests/UI/Component/Input/Field/SectionInputTest.php @@ -1,7 +1,5 @@ assertTrue($select->_isClientSideValueOk("")); } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -152,7 +152,7 @@ public function test_render(): void } - public function test_render_value(): void + public function testRenderValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -180,7 +180,7 @@ public function test_render_value(): void $this->assertEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; diff --git a/tests/UI/Component/Input/Field/SwitchableGroupInputTest.php b/tests/UI/Component/Input/Field/SwitchableGroupInputTest.php index db046335a943..d613b9e364d5 100644 --- a/tests/UI/Component/Input/Field/SwitchableGroupInputTest.php +++ b/tests/UI/Component/Input/Field/SwitchableGroupInputTest.php @@ -1,7 +1,5 @@ assertTrue($value->isOk()); } - public function test_max_tags_not_ok(): void + public function testMaxTagsNotOk(): void { $f = $this->buildFactory(); diff --git a/tests/UI/Component/Input/Field/TextInputTest.php b/tests/UI/Component/Input/Field/TextInputTest.php index 598c0e019c08..34cfe20595bf 100644 --- a/tests/UI/Component/Input/Field/TextInputTest.php +++ b/tests/UI/Component/Input/Field/TextInputTest.php @@ -1,7 +1,5 @@ buildFactory(); @@ -60,7 +60,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Text::class, $text); } - public function test_render(): void + public function testRender(): void { $f = $this->buildFactory(); $label = "label"; @@ -82,7 +82,7 @@ public function test_render(): void $this->assertEquals($expected, $html); } - public function test_render_error(): void + public function testRenderError(): void { $f = $this->buildFactory(); $label = "label"; @@ -106,7 +106,7 @@ public function test_render_error(): void $this->assertEquals($expected, $html); } - public function test_render_no_byline(): void + public function testRenderNoByline(): void { $f = $this->buildFactory(); $label = "label"; @@ -124,7 +124,7 @@ public function test_render_no_byline(): void $this->assertEquals($expected, $html); } - public function test_render_value(): void + public function testRenderValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -143,7 +143,7 @@ public function test_render_value(): void $this->assertEquals($expected, $html); } - public function test_render_value_0(): void + public function testRenderValue0(): void { $f = $this->buildFactory(); $label = "label"; @@ -162,7 +162,7 @@ public function test_render_value_0(): void $this->assertEquals($expected, $html); } - public function test_render_required(): void + public function testRenderRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -180,7 +180,7 @@ public function test_render_required(): void $this->assertEquals($expected, $html); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $f = $this->buildFactory(); $label = "label"; @@ -198,7 +198,7 @@ public function test_render_disabled(): void $this->assertEquals($expected, $html); } - public function test_max_length(): void + public function testMaxLength(): void { $f = $this->buildFactory(); @@ -215,7 +215,7 @@ public function test_max_length(): void $text->withValue("12345"); } - public function test_render_max_value(): void + public function testRenderMaxValue(): void { $f = $this->buildFactory(); $label = "label"; @@ -233,7 +233,7 @@ public function test_render_max_value(): void $this->assertEquals($expected, $html); } - public function test_value_required(): void + public function testValueRequired(): void { $f = $this->buildFactory(); $label = "label"; @@ -250,7 +250,7 @@ public function test_value_required(): void $this->assertTrue($value2->isError()); } - public function test_stripsTags(): void + public function testStripsTags(): void { $f = $this->buildFactory(); $name = "name_0"; diff --git a/tests/UI/Component/Input/Field/TextareaTest.php b/tests/UI/Component/Input/Field/TextareaTest.php index cf2dcc0d6f64..0275c18713bc 100644 --- a/tests/UI/Component/Input/Field/TextareaTest.php +++ b/tests/UI/Component/Input/Field/TextareaTest.php @@ -50,7 +50,7 @@ protected function buildFactory(): I\Input\Field\Factory ); } - public function test_implements_factory_interface(): void + public function testImplementsFactoryInterface(): void { $f = $this->buildFactory(); $textarea = $f->textarea("label", "byline"); @@ -58,7 +58,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Textarea::class, $textarea); } - public function test_implements_factory_interface_without_byline(): void + public function testImplementsFactoryInterface_without_byline(): void { $f = $this->buildFactory(); $textarea = $f->textarea("label"); @@ -66,7 +66,7 @@ public function test_implements_factory_interface_without_byline(): void $this->assertInstanceOf(Field\Textarea::class, $textarea); } - public function test_with_min_limit(): void + public function testWithMinLimit(): void { $f = $this->buildFactory(); $limit = 5; @@ -76,7 +76,7 @@ public function test_with_min_limit(): void $this->assertEquals($textarea->getMinLimit(), $limit); } - public function test_with_max_limit(): void + public function testWithMaxLimit(): void { $f = $this->buildFactory(); $limit = 15; @@ -86,7 +86,7 @@ public function test_with_max_limit(): void $this->assertEquals($textarea->getMaxLimit(), $limit); } - public function test_is_limited(): void + public function testIsLimited(): void { $f = $this->buildFactory(); @@ -107,7 +107,7 @@ public function test_is_limited(): void $this->assertFalse($textarea->isLimited()); } - public function test_get_min_limit(): void + public function testGetMinLimit(): void { $f = $this->buildFactory(); $limit = 5; @@ -115,7 +115,7 @@ public function test_get_min_limit(): void $this->assertEquals($textarea->getMinLimit(), $limit); } - public function test_get_max_limit(): void + public function testGetMaxLimit(): void { $f = $this->buildFactory(); $limit = 15; @@ -124,7 +124,7 @@ public function test_get_max_limit(): void } // RENDERER - public function test_renderer(): void + public function testRenderer(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -150,7 +150,7 @@ public function test_renderer(): void $this->assertHTMLEquals($expected, $html); } - public function test_renderer_with_min_limit(): void + public function testRendererWithMinLimit(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -178,7 +178,7 @@ public function test_renderer_with_min_limit(): void $this->assertHTMLEquals($expected, $html); } - public function test_renderer_with_max_limit(): void + public function testRendererWithMaxLimit(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -206,7 +206,7 @@ public function test_renderer_with_max_limit(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $html); } - public function test_renderer_with_min_and_max_limit(): void + public function testRendererWithMinAndMaxLimit(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -237,7 +237,7 @@ public function test_renderer_with_min_and_max_limit(): void $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $html); } - public function test_renderer_counter_with_value(): void + public function testRendererCounterWithValue(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -264,7 +264,7 @@ public function test_renderer_counter_with_value(): void $this->assertHTMLEquals($expected, $html); } - public function test_renderer_with_error(): void + public function testRendererWithError(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -293,7 +293,7 @@ public function test_renderer_with_error(): void $this->assertEquals($this->brutallyTrimHTML($expected), $html); } - public function test_renderer_with_disabled(): void + public function testRendererWithDisabled(): void { $f = $this->buildFactory(); $r = $this->getDefaultRenderer(); @@ -319,7 +319,7 @@ public function test_renderer_with_disabled(): void $this->assertHTMLEquals($expected, $html); } - public function test_stripsTags(): void + public function testStripsTags(): void { $f = $this->buildFactory(); $name = "name_0"; diff --git a/tests/UI/Component/Input/Field/UrlInputTest.php b/tests/UI/Component/Input/Field/UrlInputTest.php index 87fa97055e62..2a0d254054e1 100644 --- a/tests/UI/Component/Input/Field/UrlInputTest.php +++ b/tests/UI/Component/Input/Field/UrlInputTest.php @@ -1,7 +1,5 @@ buildFactory(); $url = $factory->url("Test Label", "Test Byline"); @@ -59,7 +59,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf(Field\Url::class, $url); } - public function test_rendering(): void + public function testRendering(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -83,7 +83,7 @@ public function test_rendering(): void ); } - public function test_render_error(): void + public function testRenderError(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -111,7 +111,7 @@ public function test_render_error(): void ); } - public function test_render_no_byline(): void + public function testRenderNoByline(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -133,7 +133,7 @@ public function test_render_no_byline(): void ); } - public function test_render_value(): void + public function testRenderValue(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -157,7 +157,7 @@ public function test_render_value(): void ); } - public function test_render_required(): void + public function testRenderRequired(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); @@ -180,7 +180,7 @@ public function test_render_required(): void ); } - public function test_render_disabled(): void + public function testRenderDisabled(): void { $factory = $this->buildFactory(); $renderer = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Input/FormInputNameSourceTest.php b/tests/UI/Component/Input/FormInputNameSourceTest.php index 624cc8169940..be4b2370be5d 100644 --- a/tests/UI/Component/Input/FormInputNameSourceTest.php +++ b/tests/UI/Component/Input/FormInputNameSourceTest.php @@ -1,7 +1,5 @@ getFactory(); @@ -46,7 +46,7 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf("ILIAS\\UI\\Component\\Item\\Group", $group); } - public function test_get_title(): void + public function testGetTitle(): void { $f = $this->getFactory(); $c = $f->group("group", array( @@ -57,7 +57,7 @@ public function test_get_title(): void $this->assertEquals("group", $c->getTitle()); } - public function test_get_items(): void + public function testGetItems(): void { $f = $this->getFactory(); @@ -71,7 +71,7 @@ public function test_get_items(): void $this->assertEquals($c->getItems(), $items); } - public function test_with_actions(): void + public function testWithActions(): void { $f = $this->getFactory(); @@ -89,7 +89,7 @@ public function test_with_actions(): void $this->assertEquals($c->getActions(), $actions); } - public function test_render_base(): void + public function testRenderBase(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); @@ -129,7 +129,7 @@ public function test_render_base(): void ); } - public function test_render_with_actions(): void + public function testRenderWithActions(): void { $f = $this->getFactory(); $r = $this->getDefaultRenderer(); diff --git a/tests/UI/Component/Item/ItemNotificationTest.php b/tests/UI/Component/Item/ItemNotificationTest.php index f44f905c16d9..942be5a5fd09 100644 --- a/tests/UI/Component/Item/ItemNotificationTest.php +++ b/tests/UI/Component/Item/ItemNotificationTest.php @@ -1,7 +1,5 @@ getFactory(); @@ -42,28 +43,28 @@ public function test_implements_factory_interface(): void $this->assertInstanceOf('ILIAS\\UI\\Component\\Item\\Shy', $shy); } - public function test_with_description(): void + public function testWithDescription(): void { $f = $this->getFactory(); $c = $f->shy('shy')->withDescription('This is a shy'); $this->assertEquals('This is a shy', $c->getDescription()); } - public function test_with_property(): void + public function testWithProperty(): void { $f = $this->getFactory(); $c = $f->shy('shy')->withProperties(['name' => 'value']); $this->assertEquals(['name' => 'value'], $c->getProperties()); } - public function test_with_close(): void + public function testWithClose(): void { $f = $this->getFactory(); $c = $f->shy('shy')->withClose((new I\Component\Button\Factory())->close()); $this->assertInstanceOf(I\Component\Button\Close::class, $c->getClose()); } - public function test_with_lead_icon(): void + public function testWithLeadIcon(): void { $f = $this->getFactory(); $c = $f->shy('shy')->withLeadIcon( @@ -72,7 +73,7 @@ public function test_with_lead_icon(): void $this->assertInstanceOf(I\Component\Symbol\Icon\Icon::class, $c->getLeadIcon()); } - public function test_render_base(): void + public function testRenderBase(): void { $c = $this->getFactory()->shy('shy'); @@ -90,7 +91,7 @@ public function test_render_base(): void ); } - public function test_render_critical(): void + public function testRenderCritical(): void { $c = $this->getFactory()->shy('noid">', $html); } - public function test_render_async_with_js_twice(): void + public function testRenderAsyncWithJsTwice(): void { $c1 = new TestComponent("foo"); $c2 = new JSTestComponent("foo"); @@ -157,7 +157,7 @@ public function test_render_async_with_js_twice(): void $this->assertEquals('foo', $html); } - public function test_render_async_array(): void + public function testRenderAsyncArray(): void { $c1 = new TestComponent("foo"); @@ -169,9 +169,9 @@ public function test_render_async_array(): void } /** - * @dataProvider render_type + * @dataProvider getRenderType */ - public function test_passes_self_as_root_if_no_root_exist($render_type) + public function testPassesSelfAsRootIfNoRootExist($render_type) { $this->component_renderer = $this->createMock(ComponentRenderer::class); $component = $this->createMock(C\Component::class); @@ -201,9 +201,9 @@ protected function getJSCodeForAsyncRenderingFor(C\Component $component) } /** - * @dataProvider render_type + * @dataProvider getRenderType */ - public function test_passes_other_on_as_root($render_type) + public function testPassesOtherOnAsRoot($render_type) { $this->component_renderer = $this->createMock(ComponentRenderer::class); $component = $this->createMock(C\Component::class); @@ -233,7 +233,7 @@ protected function getJSCodeForAsyncRenderingFor(C\Component $component) $renderer->$render_type($component, $root); } - public function render_type() + public function getRenderType() { return [ ["render"], @@ -241,7 +241,7 @@ public function render_type() ]; } - public function test_component_list_uses_root_to_render() + public function testComponentListUsesRootToRender() { $component = $this->createMock(C\Component::class); $root = $this->createMock(Renderer::class); diff --git a/tests/UI/Renderer/TestComponent.php b/tests/UI/Renderer/TestComponent.php index b73cd9bf6304..7f952926d5a6 100644 --- a/tests/UI/Renderer/TestComponent.php +++ b/tests/UI/Renderer/TestComponent.php @@ -1,7 +1,5 @@ URI_COMPLETE = new \ILIAS\Data\URI('https://www.ilias.de/foo/bar?var1=42&var2=foo#12345'); } - public function test_get_url(): void + public function testGetUrl(): void { $url = new URLBuilder($this->URI_COMPLETE); $this->assertInstanceOf(\ILIAS\Data\URI::class, $url->buildURI()); $this->assertEquals('https://www.ilias.de/foo/bar?var1=42&var2=foo#12345', (string) $url->buildURI()); } - public function test_acquire_param(): void + public function testAcquireParam(): void { $url = new URLBuilder($this->URI_COMPLETE); $result = $url->acquireParameter(['test'], 'title'); @@ -51,7 +52,7 @@ public function test_acquire_param(): void $this->assertNotEmpty($result[1]->getToken()); } - public function test_acquire_param_with_long_namespace(): void + public function testAcquireParamWithLongNamespace(): void { $url = new URLBuilder($this->URI_COMPLETE); $result = $url->acquireParameter(['test', 'object', 'metadata'], 'title'); @@ -74,7 +75,7 @@ public function test_acquire_param_with_long_namespace(): void $this->assertNotEmpty($result[1]->getToken()); } - public function test_acquire_param_with_value(): void + public function testAcquireParamWithValue(): void { $url = new URLBuilder($this->URI_COMPLETE); $sep = URLBuilder::SEPARATOR; @@ -89,7 +90,7 @@ public function test_acquire_param_with_value(): void $this->assertNotEmpty($result[1]->getToken()); } - public function test_acquire_param_with_same_name(): void + public function testAcquireParamWithSameName(): void { $url = new URLBuilder($this->URI_COMPLETE); $sep = URLBuilder::SEPARATOR; @@ -109,7 +110,7 @@ public function test_acquire_param_with_same_name(): void $this->assertNotEquals($result[1]->getToken(), $result2[1]->getToken()); } - public function test_write_param(): void + public function testWriteParam(): void { $url = new URLBuilder($this->URI_COMPLETE); $sep = URLBuilder::SEPARATOR; @@ -137,7 +138,7 @@ public function test_write_param(): void ); } - public function test_delete_param(): void + public function testDeleteParam(): void { $url = new URLBuilder($this->URI_COMPLETE); $sep = URLBuilder::SEPARATOR; @@ -151,7 +152,7 @@ public function test_delete_param(): void $this->assertEquals('https://www.ilias.de/foo/bar?var1=42&var2=foo#12345', (string) $url->buildURI()); } - public function test_url_too_long(): void + public function testUrlTooLong(): void { $url = new URLBuilder($this->URI_COMPLETE); $result = $url->acquireParameter(['test'], 'title', random_bytes(URLBuilder::URL_MAX_LENGTH)); @@ -159,7 +160,7 @@ public function test_url_too_long(): void $output = $result[0]->buildURI(); } - public function test_remove_and_add_fragment(): void + public function testRemoveAndAddFragment(): void { $url = new URLBuilder($this->URI_COMPLETE); $url = $url->withFragment(''); // set fragment to empty @@ -173,7 +174,7 @@ public function test_remove_and_add_fragment(): void $this->assertEquals('https://www.ilias.de/foo/bar?var1=42&var2=foo#54321', (string) $url->buildURI()); } - public function test_with_uri(): void + public function testWithUri(): void { $url = new URLBuilder($this->URI_COMPLETE); $result = $url->acquireParameter(['test'], 'title', 'bar'); @@ -186,7 +187,7 @@ public function test_with_uri(): void ); } - public function test_render_tokens(): void + public function testRenderTokens(): void { $url = new URLBuilder($this->URI_COMPLETE); @@ -210,7 +211,7 @@ public function test_render_tokens(): void $this->assertEquals($expected_token, $url->renderTokens([$result1[1], $result2[1]])); } - public function test_render_object(): void + public function testRenderObject(): void { $url = new URLBuilder($this->URI_COMPLETE); diff --git a/tests/UI/URLBuilderTokenTest.php b/tests/UI/URLBuilderTokenTest.php index 68274c1e3d89..d2ec6fe0b3f6 100644 --- a/tests/UI/URLBuilderTokenTest.php +++ b/tests/UI/URLBuilderTokenTest.php @@ -15,6 +15,7 @@ * https://github.com/ILIAS-eLearning * *********************************************************************/ + declare(strict_types=1); namespace ILIAS\UI; @@ -23,7 +24,7 @@ class URLBuilderTokenTest extends TestCase { - public function test_construct(): void + public function testConstruct(): void { $token = new URLBuilderToken(['test'], 'foo'); $this->assertInstanceOf(URLBuilderToken::class, $token); @@ -31,13 +32,13 @@ public function test_construct(): void $this->assertNotEmpty($token->getToken()); } - public function test_token_length(): void + public function testTokenLength(): void { $token = new URLBuilderToken(['test'], 'foo'); $this->assertEquals(URLBuilderToken::TOKEN_LENGTH, strlen($token->getToken())); } - public function test_token_name(): void + public function testTokenName(): void { $token = new URLBuilderToken(['test'], 'foo'); $this->assertEquals('test_foo', $token->getName());