HttpBrowserTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 7
c 2
b 0
f 1
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A can_use_http_browser_as_typehint() 0 7 1
A browser() 0 3 1
1
<?php
2
3
namespace Zenstruck\Browser\Tests;
4
5
use Symfony\Component\Panther\PantherTestCase;
6
use Zenstruck\Browser\HttpBrowser;
7
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
final class HttpBrowserTest extends PantherTestCase
12
{
13
    use BrowserKitBrowserTests;
0 ignored issues
show
introduced by
The trait Zenstruck\Browser\Tests\BrowserKitBrowserTests requires some properties which are not provided by Zenstruck\Browser\Tests\HttpBrowserTest: $preActionsCalled, $preAssertionsCalled
Loading history...
14
15
    /**
16
     * @test
17
     */
18
    public function can_use_http_browser_as_typehint(): void
19
    {
20
        $this->browser()
21
            ->use(function(HttpBrowser $browser) {
22
                $browser->visit('/redirect1');
23
            })
24
            ->assertOn('/page1')
25
        ;
26
    }
27
28
    protected function browser(): HttpBrowser
29
    {
30
        return $this->httpBrowser();
31
    }
32
}
33