Пример #1
0
 public function setUp()
 {
     $this->backend = new Backend\Mock('foobar');
     $this->abinfo = $this->backend->getAddressBook('foo');
     $this->ab = new AddressBook($this->backend, $this->abinfo);
     $this->contact = $this->ab->getChild('123');
 }
 public function testGetChildNotFound()
 {
     try {
         $contact = $this->ab->getChild('Nowhere');
     } catch (\Exception $e) {
         $this->assertEquals('Contact not found', $e->getMessage());
         $this->assertEquals(404, $e->getCode());
         return;
     }
     $this->fail('Expected Exception 404.');
 }