public function test_tryGetById() { $cs = new Changeset(); $this->assertNull($cs->tryGetById(1000, 'Pasinter\\Mocks\\Entity\\Blog\\Post')); $post = new Post(1000); $cs->identityMap['Pasinter\\Mocks\\Entity\\Blog\\Post'][$post->getId()] = $post; $this->assertInstanceOf('Pasinter\\Mocks\\Entity\\Blog\\Post', $cs->tryGetById($post->getId(), 'Pasinter\\Mocks\\Entity\\Blog\\Post')); }
/** * * @param int|string $id * @param string $rootClassName * @return object */ public function tryGetById($id, $rootClassName) { return $this->cs->tryGetById($id, $rootClassName); }