mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 05:49:29 +00:00
Can tests for BaseUniqueObject
This commit is contained in:
parent
a6021aeffc
commit
3d297a01f5
@ -12,5 +12,4 @@ class APIClientTest extends TestCase {
|
||||
$client->set_token("token");
|
||||
$this->assertEquals(TRUE, $client->has_token());
|
||||
}
|
||||
|
||||
}
|
20
tests/classes/models/BaseUniqueModelTest.php
Normal file
20
tests/classes/models/BaseUniqueModelTest.php
Normal 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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user