| 1 | <?php |
||
| 15 | class MarkdownDocumentTest extends TestCase |
||
| 16 | { |
||
| 17 | private $document, $params; |
||
| 18 | |||
| 19 | protected function setUp() |
||
| 20 | { |
||
| 21 | $this->params = [ |
||
| 22 | 'id' => 'testId' |
||
| 23 | ]; |
||
| 24 | $this->document = new MarkdownDocument($this->params, 'testContent'); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testGetParams() |
||
| 28 | { |
||
| 29 | $this->assertSame($this->params, $this->document->getParams()); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function testGetContent() |
||
| 33 | { |
||
| 34 | $this->assertSame('testContent', $this->document->getContent()); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testGetParam() |
||
| 38 | { |
||
| 39 | $this->assertSame('testId', $this->document->getParam('id')); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function testGetParamNotExistingReturnsNull() |
||
| 43 | { |
||
| 44 | $this->assertNull($this->document->getParam('not-existing')); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function testGetParamNotExistingReturnsGivenDefaultValue() |
||
| 48 | { |
||
| 49 | $this->assertSame('defaultValue', $this->document->getParam('not-existing', 'defaultValue')); |
||
| 50 | } |
||
| 51 | } |