public function testCreateService() { $item = Item::CreateService('Test Service Name', 2, 0, 10, ''); $this->assertInstanceOf('Item', $item); $this->assertTrue(filter_var($item->id, FILTER_VALIDATE_INT) == true); $this->assertTrue($item->name == 'Test Service Name'); $this->assertTrue($item->scope == 2); $this->assertTrue($item->vat == 0); $this->assertTrue($item->category == 10); $this->assertTrue($item->description == ''); }
public function createService($name, $scope, $vat, $category, $desc) { if (Item::CreateService($name, $scope, $vat, $category, $desc)) { echo 1; } else { echo 0; } }