/** * @dataProvider provideExistingFlag */ public function testGetByInternalId($exist) { $record = $this->table->createRecord(array('id' => 7, 'username' => 'Bart'), $exist); $id = $record->getInternalId(); $isInRepository = $this->repository->hasByInternalId($id); $this->assertTrue($isInRepository); $this->assertEquals($record, $this->repository->getByInternalId($id)); }
/** * Returns true, if repository contains record * * @param string $id * @return bool */ public function isInRepository($id) { return $this->repository->hasByInternalId($id); }