| Total Complexity | 9 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class MicroControllerTest extends WebTestCase |
||
| 6 | { |
||
| 7 | public function testIndexAction() |
||
| 13 | } |
||
| 14 | |||
| 15 | public function testDbAction() |
||
| 20 | } |
||
| 21 | |||
| 22 | public function testDiAction() |
||
| 23 | { |
||
| 24 | $this->doRequest('/di') |
||
| 25 | ->assertResponseOk(); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testMailAction() |
||
| 29 | { |
||
| 30 | $this->doRequest('/mail') |
||
| 31 | ->assertResponseOk() |
||
| 32 | ->assertResponseContains('You can check mail logs in <code>example/.var/mail/</code>'); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function testLoggerAction() |
||
| 36 | { |
||
| 37 | $this->doRequest('/logger') |
||
| 38 | ->assertResponseOk() |
||
| 39 | ->assertResponseContains('info from echo logger') |
||
| 40 | ->assertResponseContains('error from echo logger'); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testValidationAction() |
||
| 51 | } |
||
| 52 | |||
| 53 | public function testValidationPass() |
||
| 54 | { |
||
| 55 | $this->doRequest('/validation', ['name' => 'Adhocore', 'id' => 12, 'email' => '[email protected]']) |
||
| 56 | ->assertResponseOk(); |
||
| 57 | } |
||
| 58 | |||
| 59 | public function testCorsAction() |
||
| 60 | { |
||
| 61 | $this->doRequest('/cors') |
||
| 62 | ->assertResponseOk() |
||
| 63 | ->assertResponseContains('CORS request will be triggered by fetching host http://localhost:1234/' |
||
| 64 | . ' from different origin http://127.0.01:1234/'); |
||
| 65 | } |
||
| 66 | |||
| 67 | public function testCorsHeaderAction() |
||
| 72 | } |
||
| 73 | } |
||
| 74 |