| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function testRemove() |
||
| 28 | { |
||
| 29 | $filter = 'testfilter'; |
||
| 30 | $class = Filter::class; |
||
| 31 | $function = 'remove'; |
||
| 32 | $priority = 10; |
||
| 33 | $this->assertFalse( |
||
| 34 | Filter::remove($filter, $class, $function), |
||
| 35 | 'Should not be able te remove a filter that is not added' |
||
| 36 | ); |
||
| 37 | $filter = 'testfilter'; |
||
| 38 | $class = Filter::class; |
||
| 39 | $function = 'remove'; |
||
| 40 | $priority = 10; |
||
| 41 | add_filter($filter, [$class, $function], $priority, 0); |
||
| 42 | $this->assertTrue( |
||
| 43 | Filter::remove($filter, $class, $function), |
||
| 44 | 'Should be able te remove a filter that is added' |
||
| 45 | ); |
||
| 46 | add_filter($filter, [$class, 'test'], $priority, 0); |
||
| 47 | $this->assertFalse( |
||
| 48 | Filter::remove($filter, $class, $function), |
||
| 49 | 'Should not be able to remove a filter of which the function doesn\'t exist' |
||
| 50 | ); |
||
| 51 | $this->assertFalse( |
||
| 52 | Filter::remove($filter, $class, $function), |
||
| 53 | 'Should not be able te remove a filter that is not added' |
||
| 54 | ); |
||
| 57 |