Completed
Push — master ( 0768ef...ea365c )
by Luca
03:38
created

SubscriptionTypeTest::testIsValid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * OpenFireRestAPI is based entirely on official documentation of the REST API
4
 * Plugin and you can extend it by following the directives of the documentation
5
 *
6
 * For the full copyright and license information, please read the LICENSE
7
 * file that was distributed with this source code. For the full list of
8
 * contributors, visit https://github.com/gnello/PHPOpenFireRestAPI/contributors
9
 *
10
 * @author Luca Agnello <[email protected]>
11
 * @link https://www.igniterealtime.org/projects/openfire/plugins/restapi/readme.html
12
 */
13
14
namespace Gnello\OpenFireRestAPI;
15
16
use Gnello\OpenFireRestAPI\Settings\SubscriptionType;
17
18
/**
19
 * Class SubscriptionTypeTest
20
 * @package Gnello\OpenFireRestAPI
21
 */
22
class SubscriptionTypeTest extends \PHPUnit_Framework_TestCase
23
{
24
    public function testIsValid()
25
    {
26
        $this->assertTrue(SubscriptionType::isValid(0));
27
        $this->assertTrue(SubscriptionType::isValid(1));
28
        $this->assertTrue(SubscriptionType::isValid(2));
29
        $this->assertTrue(SubscriptionType::isValid(3));
30
    }
31
32
    public function testIsNotValid()
33
    {
34
        $this->assertFalse(SubscriptionType::isValid(4));
35
        $this->assertFalse(SubscriptionType::isValid(-1));
36
        $this->assertFalse(SubscriptionType::isValid('test'));
37
        $this->assertFalse(SubscriptionType::isValid(array(1,2)));
38
        $this->assertFalse(SubscriptionType::isValid(true));
39
    }
40
}