| Total Complexity | 1 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ReadOnlyExceptionTest extends TestCase |
||
| 10 | { |
||
| 11 | |||
| 12 | public function test_message_and_code() |
||
| 13 | { |
||
| 14 | $ex1 = ReadOnlyException::forCloning('Foo'); |
||
| 15 | $ex2 = ReadOnlyException::forInstance('foo', 'Bar'); |
||
| 16 | |||
| 17 | $this->assertEquals('Cloning the Foo instance is not allowed', $ex1->getMessage()); |
||
| 18 | $this->assertSame(Data::E_CLONING_DISALLOWED, $ex1->getCode()); |
||
| 19 | |||
| 20 | $this->assertEquals('Cannot set foo. Bar instance is read-only', $ex2->getMessage()); |
||
| 21 | $this->assertSame(Data::E_READONLY_INSTANCE, $ex2->getCode()); |
||
| 22 | } |
||
| 24 |