Passed
Pull Request — 1.x (#23)
by Wouter
01:49
created

HasBrowser::browser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Zenstruck\Browser\Test;
4
5
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7
use Symfony\Component\BrowserKit\HttpBrowser as HttpBrowserClient;
8
use Symfony\Component\Panther\Client as PantherClient;
9
use Symfony\Component\Panther\PantherTestCase;
10
use Zenstruck\Browser\HttpBrowser;
11
use Zenstruck\Browser\KernelBrowser;
12
use Zenstruck\Browser\PantherBrowser;
13
14
/**
15
 * @author Kevin Bond <[email protected]>
16
 */
17
trait HasBrowser
18
{
19
    use HasKernelBrowser, HasHttpBrowser, HasPantherBrowser {
20
        HasKernelBrowser::browser insteadof HasHttpBrowser;
21
        HasKernelBrowser::browser as kernelBrowser;
22
        HasHttpBrowser::browser as httpBrowser;
23
        HasPantherBrowser::browser as pantherBrowser;
24
    }
25
26
    protected function browser(): void
27
    {
28
        throw new \BadMethodCallException(sprintf('"%s" cannot be used when using the "HasBrowser" trait, use any of "kernelBrowser()", "httpBrowser()" or "pantherBrowser()" instead.', __METHOD__));
29
    }
30
}
31