TYPO3 CMS  TYPO3_6-2
MessageTest.php
Go to the documentation of this file.
1 <?php
3 
21 
27  $messageMessage = 'The message';
28  $error = new \TYPO3\CMS\Extbase\Error\Message($messageMessage, 0);
29  $this->assertEquals($messageMessage, $error->getMessage());
30  }
31 
37  $messageCode = 123456789;
38  $error = new \TYPO3\CMS\Extbase\Error\Message('', $messageCode);
39  $this->assertEquals($messageCode, $error->getCode());
40  }
41 
47  $messageArguments = array('foo', 'bar');
48  $error = new \TYPO3\CMS\Extbase\Error\Message('', 1, $messageArguments);
49  $this->assertEquals($messageArguments, $error->getArguments());
50  }
51 
57  $messageTitle = 'Title';
58  $error = new \TYPO3\CMS\Extbase\Error\Message('', 1, array(), $messageTitle);
59  $this->assertEquals($messageTitle, $error->getTitle());
60  }
61 
67  $error = new \TYPO3\CMS\Extbase\Error\Message('Message', 1);
68  $this->assertEquals('Message', $error->render());
69  }
70 
76  $error = new \TYPO3\CMS\Extbase\Error\Message('Foo is %s and Bar is %s', 1, array('baz', 'qux'));
77  $this->assertEquals('Foo is baz and Bar is qux', $error->render());
78  }
79 
84  public function toStringCallsRender() {
85  $error = new \TYPO3\CMS\Extbase\Error\Message('Foo is %s and Bar is %s', 1, array('baz', 'qux'));
86  $this->assertEquals('Foo is baz and Bar is qux', $error);
87  }
88 }