@@ 25-39 (lines=15) @@ | ||
22 | $response->assertSee($expectedResult); |
|
23 | } |
|
24 | ||
25 | public function testSuccessfulDrip() |
|
26 | { |
|
27 | $dripRoute = config('genealabs-laravel-caffeine.route', 'genealabs/laravel-caffeine/drip'); |
|
28 | $html = $this->get(route('genealabs-laravel-caffeine.tests.form')) |
|
29 | ->getContent(); |
|
30 | $matches = []; |
|
31 | preg_match('/<meta name="csrf-token" content="(.*?)">/', $html, $matches); |
|
32 | $csrfToken = $matches[1]; |
|
33 | ||
34 | $response = $this->get($dripRoute, [ |
|
35 | '_token' => $csrfToken, |
|
36 | ]); |
|
37 | ||
38 | $response->assertStatus(204); |
|
39 | } |
|
40 | ||
41 | public function testExpiredDrip() |
|
42 | { |
|
@@ 41-56 (lines=16) @@ | ||
38 | $response->assertStatus(204); |
|
39 | } |
|
40 | ||
41 | public function testExpiredDrip() |
|
42 | { |
|
43 | $dripRoute = config( |
|
44 | 'genealabs-laravel-caffeine.dripInterval', |
|
45 | 'genealabs/laravel-caffeine/drip' |
|
46 | ); |
|
47 | $html = $this->get(route('genealabs-laravel-caffeine.tests.form')) |
|
48 | ->getContent(); |
|
49 | $matches = []; |
|
50 | preg_match( |
|
51 | '/<meta name="csrf-token" content="(.*?)">/', |
|
52 | $html, |
|
53 | $matches |
|
54 | ); |
|
55 | $csrfToken = $matches[1]; |
|
56 | ||
57 | app('session')->flush(); |
|
58 | $response = $this->get($dripRoute, [ |
|
59 | '_token' => $csrfToken, |