From e2d774c120bf900337476b30f5400074db49a2a6 Mon Sep 17 00:00:00 2001 From: Edi Modric Date: Wed, 7 Sep 2022 11:16:03 +0200 Subject: [PATCH] Remove test for XmlText field handler --- tests/Handler/FieldType/XmlTextTest.php | 111 ------------------------ 1 file changed, 111 deletions(-) delete mode 100644 tests/Handler/FieldType/XmlTextTest.php diff --git a/tests/Handler/FieldType/XmlTextTest.php b/tests/Handler/FieldType/XmlTextTest.php deleted file mode 100644 index 1feb772..0000000 --- a/tests/Handler/FieldType/XmlTextTest.php +++ /dev/null @@ -1,111 +0,0 @@ -fieldHelper = $this->getMockBuilder(FieldHelper::class) - ->disableOriginalConstructor() - ->onlyMethods(['isFieldEmpty']) - ->getMock(); - - $this->content = $this->getMockBuilder(Content::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->richText = new XmlText($this->fieldHelper); - $this->richText->setContent($this->content); - - $this->field = new Field(['value' => new Value(), 'fieldDefIdentifier' => 'field']); - } - - public function testInstanceOfHandlerInterface(): void - { - self::assertInstanceOf(HandlerInterface::class, $this->richText); - } - - public function testGettingTagsWithoutFieldIdentifier(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Argument '\$params[0]' is invalid: Field type handlers require at least a field identifier."); - - $this->richText->getMetaTags('some_tag'); - } - - public function testGettingTagsWithNonExistentField(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Argument '\$params[0]' is invalid: Field 'some_value' does not exist in content."); - - $this->content->expects(self::once()) - ->method('getField') - ->willReturn(null); - - $this->richText->getMetaTags('some_tag', ['some_value']); - } - - public function testGettingTagsWithUnsupportedField(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Argument '\$params[0]' is invalid: Netgen\\Bundle\\OpenGraphBundle\\Handler\\FieldType\\XmlText field type handler does not support field with identifier 'field'."); - - $this->content->expects(self::once()) - ->method('getField') - ->willReturn(new Field(['fieldDefIdentifier' => 'field'])); - - $this->richText->getMetaTags('some_tag', ['some_value']); - } - - public function testGettingTagsWithEmptyField(): void - { - $this->content->expects(self::once()) - ->method('getField') - ->willReturn($this->field); - - $this->fieldHelper->expects(self::once()) - ->method('isFieldEmpty') - ->willReturn(true); - - $this->richText->getMetaTags('some_tag', ['some_value']); - } - - public function testGettingTags(): void - { - $this->content->expects(self::once()) - ->method('getField') - ->willReturn($this->field); - - $this->richText->getMetaTags('some_tag', ['some_value']); - } - - public function testGettingTagsWithMultipleArgumentsInArray(): void - { - $this->content->expects(self::once()) - ->method('getField') - ->willReturn($this->field); - - $this->richText->getMetaTags('some_tag', ['some_value', 'some_value_2']); - } -}