Can tests for BaseUniqueObject

This commit is contained in:
Pierre HUBERT 2018-07-12 14:10:41 +02:00
parent a6021aeffc
commit 3d297a01f5
2 changed files with 20 additions and 1 deletions

View File

@ -12,5 +12,4 @@ class APIClientTest extends TestCase {
$client->set_token("token");
$this->assertEquals(TRUE, $client->has_token());
}
}

View File

@ -0,0 +1,20 @@
<?php
//Include class
require_once(__DIR__."/../../../classes/models/BaseUniqueObject.php");
use PHPUnit\Framework\TestCase;
class BaseUniqueObjectTest extends TestCase {
public function testValidObjectWithoutId(){
$obj = new BaseUniqueObject();
$obj->set_id(10);
$this->assertEquals(TRUE, $obj->isValid());
}
public function testInvalidObjectWithoutId(){
$obj = new BaseUniqueObject();
$this->assertEquals(FALSE, $obj->isValid());
}
}