Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractMessageTest.php
Go to the documentation of this file.
1 <?php
7 
11 class AbstractMessageTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $model;
17 
18  protected function setUp()
19  {
20  $this->model = new TestingMessage();
21  }
22 
28  public function testSetTextGetText($text, $resultText)
29  {
30  $this->model->setText($text);
31  $this->assertEquals($resultText, $this->model->getText());
32  }
33 
37  public function setTextGetTextProvider()
38  {
39  return [['', ''], ['some text', 'some text'], [new \Magento\Framework\Phrase('some text'), 'some text']];
40  }
41 
47  public function testSetIdentifierGetIdentifier($identifier)
48  {
49  $this->model->setIdentifier($identifier);
50  $this->assertEquals($identifier, $this->model->getIdentifier());
51  }
52 
57  {
58  return [[''], ['some identifier']];
59  }
60 
65  public function testSetIsStickyGetIsSticky()
66  {
67  $this->assertFalse($this->model->getIsSticky());
68  $this->model->setIsSticky();
69  $this->assertTrue($this->model->getIsSticky());
70  }
71 
75  public function testToString()
76  {
77  $someText = 'some text';
78  $expectedString = TestingMessage::TYPE_TESTING . ': testing_message: ' . $someText;
79 
80  $this->model->setIdentifier('testing_message');
81  $this->model->setText($someText);
82  $this->assertEquals($expectedString, $this->model->toString());
83  }
84 }
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43