Completed
Push — master ( 8a0d58...00b043 )
by Tobias
02:38
created

LocalePluginTest::testPlugin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder\Plugin\Tests\Plugin;
14
15
use Geocoder\Plugin\Plugin\LocalePlugin;
16
use Geocoder\Query\GeocodeQuery;
17
use Geocoder\Query\Query;
18
use PHPUnit\Framework\TestCase;
19
20
class LocalePluginTest extends TestCase
21
{
22
    public function testPlugin()
23
    {
24
        $query = GeocodeQuery::create('foo');
25
        $first = function (Query $query) {
26
            $this->fail('Plugin should not restart the chain');
27
        };
28
        $next = function (Query $query) {
29
            $this->assertEquals('sv', $query->getLocale());
30
        };
31
32
        $plugin = new LocalePlugin('sv');
33
        $plugin->handleQuery($query, $next, $first);
34
    }
35
}
36