| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function authentication_最終ログイン日時確認(\AcceptanceTester $I) |
||
| 37 | { |
||
| 38 | $I->wantTo('EA0201-UC01-T01 最終ログイン日時確認'); |
||
| 39 | |||
| 40 | $I->click('header.c-headerBar div.c-headerBar__container a.c-headerBar__userMenu'); |
||
| 41 | $loginText = $I->grabTextFrom(['css' => '#page_admin_homepage div.popover .popover-body > p']); |
||
| 42 | |||
| 43 | // Format Y/m/d only |
||
| 44 | $lastLogin = preg_replace('/.*(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}).*/s', '$1', $loginText); |
||
| 45 | // 表示されるログイン日時では秒数がわからないため、タイミングによっては1分ちょっと変わる |
||
| 46 | $now = new DateTime(); |
||
| 47 | $I->assertTrue((strtotime($now->format('Y/m/d')) - strtotime($lastLogin)) < 70, '最終ログイン日時が正しい'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.