| 1 | <?php |
||
| 10 | class TextTest extends TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var Text |
||
| 14 | */ |
||
| 15 | protected $text; |
||
| 16 | |||
| 17 | public function setUp() |
||
| 18 | { |
||
| 19 | $this->text = new Text(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function testInstanceOfHandlerInterface() |
||
| 23 | { |
||
| 24 | $this->assertInstanceOf(HandlerInterface::class, $this->text); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @expectedException \eZ\Publish\Core\Base\Exceptions\InvalidArgumentException |
||
| 29 | * @expectedExceptionMessage Argument '$params[0]' is invalid: Literal text handler requires the text to output. |
||
| 30 | */ |
||
| 31 | public function testGettingTagsWithEmptyParams() |
||
| 32 | { |
||
| 33 | $this->text->getMetaTags('some_tag', array()); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function testGettingTagsWithValidResult() |
||
| 37 | { |
||
| 38 | $result = $this->text->getMetaTags('some_tag', array('some_param')); |
||
| 39 | |||
| 40 | $this->assertInternalType('array', $result); |
||
| 41 | $this->assertInstanceOf(Item::class, $result[0]); |
||
| 42 | $this->assertEquals('some_tag', $result[0]->getTagName()); |
||
| 43 | $this->assertEquals('some_param', $result[0]->getTagValue()); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |