/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage User #404 not found */ public function testNotFound() { $this->dbal->expects($this->once())->method('find')->with(404)->will($this->returnValue(array())); $user = $this->mapper->findById(404); }
/** * @expectedException \InvalidArgumentException */ public function testWillNotMapInvalidData() { $storage = new StorageAdapter([]); $mapper = new UserMapper($storage); $mapper->findById(1); }