Пример #1
0
 /**
  * @covers \PHP\Manipulator\TokenContainer::insertAtOffset
  * @covers \PHP\Manipulator\TokenContainer::<protected>
  */
 public function testInsertAtOffsetThrowsExceptionOnInsertAfterNonExistingOffset()
 {
     $token = Token::factory('Blub');
     $containter = new TokenContainer();
     try {
         $containter->insertAtOffset(5, $token);
         $this->fail('Expected exception not thrown');
     } catch (\Exception $e) {
         $this->assertEquals("Offset '5' does not exist", $e->getMessage(), 'Wrong exception message');
     }
 }