function testNonDefaultPrimaryKey() { $person = new Person(); $person->firstName = 'Katie'; $person->age = 22; $car = new Car(); $car->make = 'Honda'; $car->insert(); $person->addToCars($car); $this->assertEquals($car->pk, 3); $this->assertEquals($car->owner()->id, $person->id); }
public function testInsert() { Car::insert(array(array('id' => '20', 'name' => 'Car20', 'manufactor_id' => 1, 'owner_id' => 1))); $count = Car::count(); $this->assertEquals(5, $count, 'Car must be Inserted'); }