Example #1
0
 public function testSet()
 {
     $items = array();
     foreach (Fixtures\TestObject::createRandomInstances() as $item) {
         $items[$item->getPropertyOne()] = $item;
     }
     $items = array_values($items);
     $object_set = Fixtures\TestObjectSet::create($items);
     foreach ($items as $item) {
         $object_set->add($item);
     }
     $expected_count = count($items);
     $this->assertEquals($expected_count, count($object_set));
 }
Example #2
0
 protected function createRandomItems()
 {
     return Fixtures\TestObject::createRandomInstances();
 }
Example #3
0
 public function testToArray()
 {
     $object_data = $this->getRandomScalarValues();
     $test_object = Fixtures\TestObject::create($object_data);
     $this->assertEquals($object_data, $test_object->toArray());
 }