/** * @test */ public function getNewUidForMapWithTwoItemsInReverseOrderReturnsUidGreaterThanTheGreatesUid() { $model2 = new Tx_Oelib_Tests_Unit_Fixtures_TestingModel(); $model2->setUid(2); $this->subject->add($model2); $model1 = new Tx_Oelib_Tests_Unit_Fixtures_TestingModel(); $model1->setUid(1); $this->subject->add($model1); self::assertGreaterThan(2, $this->subject->getNewUid()); }
/** * @test */ public function findWithUidOfCachedModelReturnsThatModel() { $model = new Tx_Oelib_Tests_Unit_Fixtures_TestingModel(); $model->setUid(1); $map = new Tx_Oelib_IdentityMap(); $map->add($model); $this->subject->setMap($map); self::assertSame($model, $this->subject->find(1)); }