Ejemplo n.º 1
0
 public function testSetData()
 {
     $object = new ExtendedDataObject();
     $object->setData(['myColumn' => 'asdf123']);
     $this->assertEquals('asdf123', $object->getMyColumn());
 }
Ejemplo n.º 2
0
 public function testFindByBetween()
 {
     $object = new ExtendedDataObject();
     $object->setMyColumn('0');
     $objects[] = $object;
     $objects = [];
     $object = new ExtendedDataObject();
     $object->setMyColumn('1');
     $objects[] = $object;
     $object = new ExtendedDataObject();
     $object->setMyColumn('2');
     $objects[] = $object;
     $object = new ExtendedDataObject();
     $object->setMyColumn('3');
     $objects[] = $object;
     $object = new ExtendedDataObject();
     $object->setMyColumn('4');
     $objects[] = $object;
     $this->repository->saveAll($objects);
     /** @var ExtendedDataObject[] $betweenObjects */
     $betweenObjects = $this->repository->findBy(['myColumn BETWEEN' => [1, 3]]);
     $this->assertCount(3, $betweenObjects);
     foreach ($betweenObjects as $i => $object) {
         $this->assertEquals($i + 1, $object->getMyColumn());
     }
 }