Esempio n. 1
0
 public function testUpdate()
 {
     $Type = new Type(1);
     $Type->name = "Test Type Updated";
     $updated_name = $Type->name;
     $Type->commit();
     // Reload the operator
     $Type = new Type(1);
     $this->assertEquals($updated_name, $Type->name);
 }
Esempio n. 2
0
 public function test_break_validate()
 {
     $this->setExpectedException("Exception", "Cannot validate changes to this loco type: name cannot be empty");
     $Type = new Type();
     $Type->commit();
 }
Esempio n. 3
0
 /**
  * @depends testAddLocoClass 
  */
 public function testGetClassByType($class_id)
 {
     $Class = LocosFactory::CreateLocoClass($class_id);
     $Type = new Type($Class->type_id);
     foreach ($Type->getClasses() as $row) {
         $this->assertEquals($row['type']['id'], $Type->id);
     }
 }