public function testUpdate() { $Operator = new Operator(1); $Operator->name = "Test Operator Updated"; $Operator->organisation_id = 200; $updated_name = $Operator->name; $updated_org_id = $Operator->organisation_id; $Operator->commit(); // Reload the operator $Operator = new Operator(1); $this->assertEquals($updated_name, $Operator->name); $this->assertEquals($updated_org_id, $Operator->organisation_id); }
public function testAddOperator() { $Operator = new Operator(); $Operator->name = self::OPERATOR; $Operator->commit(); $this->assertFalse(!filter_var($Operator->id, FILTER_VALIDATE_INT)); $this->operator_id = $Operator->id; $Owner = new Operator(); $Owner->name = self::OWNER; $Owner->commit(); $this->assertFalse(!filter_var($Owner->id, FILTER_VALIDATE_INT)); return $Owner->id; }
public function test_break_name() { $this->setExpectedException("Exception", "Cannot validate Operator: the operator name cannot be empty"); $Operator = new Operator(); $Operator->commit(); }