| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function testExecute() |
||
| 30 | { |
||
| 31 | // Remove any existing members from the database |
||
| 32 | Member::get()->removeAll(); |
||
| 33 | |||
| 34 | $questionHelper = $this |
||
| 35 | ->getMockBuilder(QuestionHelper::class) |
||
| 36 | ->setMethods(['ask']) |
||
| 37 | ->getMock(); |
||
| 38 | |||
| 39 | $questionHelper |
||
| 40 | ->expects($this->atLeastOnce()) |
||
| 41 | ->method('ask') |
||
| 42 | ->willReturn(false); |
||
| 43 | |||
| 44 | $this->command->getApplication()->getHelperSet()->set($questionHelper, 'question'); |
||
| 45 | |||
| 46 | $tester = $this->executeTest( |
||
| 47 | [ |
||
| 48 | 'email' => '[email protected]', |
||
| 49 | 'password' => 'opensesame' |
||
| 50 | ] |
||
| 51 | ); |
||
| 52 | $output = $tester->getDisplay(); |
||
| 53 | $this->assertContains('Member created', $output); |
||
| 54 | } |
||
| 55 | |||
| 66 |