/
FilterBlacklistTest.php
41 lines (36 loc) · 1.39 KB
/
FilterBlacklistTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Oriskami;
class FilterBlacklistTest extends TestCase
{
public function __construct()
{
self::authorizeFromEnv();
// CRUD ___________________________________
// Update .....
$this->updated1 = FilterBlacklist::update("0", array("is_active" => "true"));
$this->updated2 = FilterBlacklist::update("0", array("is_active" => "false"));
// List .....
$this->listed1 = FilterBlacklist::all();
}
public function testExists()
{
self::log(__METHOD__, "Should exist" );
$this->assertNotNull($this->updated1 );
$this->assertNotNull($this->updated2 );
$this->assertNotNull($this->listed1 );
}
public function testClass()
{
self::log(__METHOD__, "Should have the right class");
$this->assertInstanceOf("Oriskami\\FilterBlacklist", $this->updated1[0]);
$this->assertInstanceOf("Oriskami\\FilterBlacklist", $this->updated1[0]);
$this->assertInstanceOf("Oriskami\\FilterBlacklist", $this->updated2[0]);
$this->assertInstanceOf("Oriskami\\FilterBlacklist", $this->listed1[0]);
}
public function testAttr()
{
self::log(__METHOD__, "Should have the expected attributes");
$this->assertEquals( $this->updated1[0]["is_active"]."", "true");
$this->assertEquals( $this->updated2[0]["is_active"]."", "false");
}
}