Completed
Pull Request — master (#589)
by Franco
34:06
created

UserDefinedForm_EmailRecipientConditionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMatches() 0 51 1
1
<?php
2
3
/**
4
 * Class EditableCustomRulesTest
5
 */
6
class UserDefinedForm_EmailRecipientConditionTest extends SapphireTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    protected static $fixture_file = 'userforms/tests/UserDefinedForm_EmailRecipientConditionTest.yml';
9
10
    /**
11
     * Various matching tests
12
     */
13
    public function testMatches()
14
    {
15
        $fixtureClass = 'UserDefinedForm_EmailRecipientCondition';
16
        //Test Blank
17
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
18
        $blankObj = $this->objFromFixture($fixtureClass, 'blankTest');
19
        $this->assertTrue($blankObj->matches(array('Name' => null)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20
        $this->assertFalse($blankObj->matches(array('Name' => 'Jane')));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
22
        //Test IsNotBlank
23
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
24
        $blankObj = $this->objFromFixture($fixtureClass, 'isNotBlankTest');
25
        $this->assertTrue($blankObj->matches(array('Name' => 'Jane')));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
        $this->assertFalse($blankObj->matches(array('Name' => null)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
27
28
        //Test ValueLessthan
29
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
30
        $blankObj = $this->objFromFixture($fixtureClass, 'valueLessThanTest');
31
        $this->assertTrue($blankObj->matches(array('Age' => 17)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
32
        $this->assertFalse($blankObj->matches(array('Age' => 19)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
34
        //Test ValueLessThanEquals
35
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
36
        $blankObj = $this->objFromFixture($fixtureClass, 'valueLessThanEqualTest');
37
        $this->assertTrue($blankObj->matches(array('Age' => 18)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
        $this->assertFalse($blankObj->matches(array('Age' => 19)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
40
        //Test ValueGreaterThan
41
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
42
        $blankObj = $this->objFromFixture($fixtureClass, 'valueGreaterThanTest');
43
        $this->assertTrue($blankObj->matches(array('Age' => 19)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
44
        $this->assertFalse($blankObj->matches(array('Age' => 17)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
46
        //Test ValueGreaterThanEquals
47
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
48
        $blankObj = $this->objFromFixture($fixtureClass, 'valueGreaterThanEqualTest');
49
        $this->assertTrue($blankObj->matches(array('Age' => 18)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
50
        $this->assertFalse($blankObj->matches(array('Age' => 17)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
51
52
        //Test Equals
53
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
54
        $blankObj = $this->objFromFixture($fixtureClass, 'equalsTest');
55
        $this->assertTrue($blankObj->matches(array('Age' => 18)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
56
        $this->assertFalse($blankObj->matches(array('Age' => 17)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
58
        //Test NotEquals
59
        /** @var UserDefinedForm_EmailRecipientCondition $blankObj */
60
        $blankObj = $this->objFromFixture($fixtureClass, 'notEqualsTest');
61
        $this->assertTrue($blankObj->matches(array('Age' => 17)));
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
62
        $this->assertFalse($blankObj->matches(array('Age' => 18)));
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<UserDefinedForm_E...RecipientConditionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
    }
64
}
65