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

SubscriptionTypeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsValid() 0 7 1
A testIsNotValid() 0 8 1
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
}