| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function titleProvider() { |
||
| 35 | $title = $this->getMockBuilder( 'Title' ) |
||
| 36 | ->disableOriginalConstructor() |
||
| 37 | ->setMethods( [ 'exists' ] ) |
||
| 38 | ->getMock(); |
||
| 39 | $title->expects( $this->any() ) |
||
| 40 | ->method( 'exists' ) |
||
| 41 | ->will( $this->returnValue( false ) ); |
||
| 42 | |||
| 43 | return [ |
||
| 44 | [ |
||
| 45 | 'value' => null, |
||
| 46 | 'hasToExist' => false, |
||
| 47 | 'expectedErrors' => Error::newError( 'Not a title' ) |
||
| 48 | ], |
||
| 49 | [ |
||
| 50 | 'value' => $title, |
||
| 51 | 'hasToExist' => false, |
||
| 52 | 'expectedErrors' => null |
||
| 53 | ], |
||
| 54 | [ |
||
| 55 | 'value' => $title, |
||
| 56 | 'hasToExist' => true, |
||
| 57 | 'expectedErrors' => Error::newError( 'Title does not exist' ) |
||
| 58 | ], |
||
| 59 | ]; |
||
| 60 | } |
||
| 61 | |||
| 63 |