/** * @depends testCreateEntity */ public function testNotIlike($arr) { $testEntity = $arr['entity']; $referenceEntity = TestModel::factory($arr['refGuid']); $this->assertSame($arr['refGuid'], $referenceEntity->guid); // Retrieving entity by !data... $resultEntity = Nymph::getEntities(['class' => 'TestModel'], ['&', 'tag' => 'test', '!ilike' => ['string', 'wr_n%']]); $this->assertTrue($testEntity->inArray($resultEntity)); $this->assertFalse($referenceEntity->inArray($resultEntity)); }
/** * @depends testAssignment */ public function testReferences($arr) { $testEntity = $arr['entity']; $testEntity->refresh(); $this->assertSame($arr['refGuid'], $testEntity->reference->guid); $this->assertSame($arr['refGuid'], $testEntity->ref_array[0]['entity']->guid); $this->assertSame($arr['refGuid'], $testEntity->ref_object->thing->entity->guid); $entity = TestModel::factory($testEntity->guid); $this->assertSame($arr['refGuid'], $entity->reference->guid); $this->assertSame($arr['refGuid'], $entity->ref_array[0]['entity']->guid); $this->assertSame($arr['refGuid'], $entity->ref_object->thing->entity->guid); }