| @@ 69-83 (lines=15) @@ | ||
| 66 | ); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testCheckIfValueIsOfRightObjectType() |
|
| 70 | { |
|
| 71 | $rule = Rule::fromArray( |
|
| 72 | $ruleConfiguration = [ |
|
| 73 | Rule::TYPE_OBJECT => [ |
|
| 74 | '\DateTime', |
|
| 75 | ] |
|
| 76 | ] |
|
| 77 | ); |
|
| 78 | ||
| 79 | $this->assertSame( |
|
| 80 | true, |
|
| 81 | $rule->is(Rule::TYPE_OBJECT) |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCheckIfValueIsNotOfRightObjectType() |
|
| 86 | { |
|
| @@ 85-99 (lines=15) @@ | ||
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCheckIfValueIsNotOfRightObjectType() |
|
| 86 | { |
|
| 87 | $rule = Rule::fromArray( |
|
| 88 | $ruleConfiguration = [ |
|
| 89 | Rule::TYPE_OBJECT => [ |
|
| 90 | '\DateTime', |
|
| 91 | ] |
|
| 92 | ] |
|
| 93 | ); |
|
| 94 | ||
| 95 | $this->assertSame( |
|
| 96 | false, |
|
| 97 | $rule->isNot(Rule::TYPE_OBJECT) |
|
| 98 | ); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testGetExpectedType() |
|
| 102 | { |
|
| @@ 101-115 (lines=15) @@ | ||
| 98 | ); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testGetExpectedType() |
|
| 102 | { |
|
| 103 | $rule = Rule::fromArray( |
|
| 104 | $ruleConfiguration = [ |
|
| 105 | Rule::TYPE_OBJECT => [ |
|
| 106 | '\DateTime', |
|
| 107 | ] |
|
| 108 | ] |
|
| 109 | ); |
|
| 110 | ||
| 111 | $this->assertSame( |
|
| 112 | ['\DateTime'], |
|
| 113 | $rule->getExpectedType() |
|
| 114 | ); |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||