Test Failed
Push — master ( 8413e5...65cae7 )
by Jakub
02:11
created

ChainLocaleResolverTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testResolve() 0 8 1
A setUp() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Translation\Resolvers;
5
6
use Tester\Assert;
7
8
require __DIR__ . "/../../../bootstrap.php";
9
10
/**
11
 * @author Jakub Konečný
12
 * @testCase
13
 */
14
final class ChainLocaleResolverTest extends \Tester\TestCase {
15
  protected ChainLocaleResolver $resolver;
16
  
17
  protected function setUp(): void {
18
    $this->resolver = new ChainLocaleResolver();
19
  }
20
  
21
  public function testResolve(): void {
22
    Assert::null($this->resolver->resolve());
23
    $this->resolver[] = new ManualLocaleResolver();
24
    Assert::null($this->resolver->resolve());
25
    $resolver = new ManualLocaleResolver();
26
    $this->resolver[] = $resolver;
27
    $resolver->lang = "en";
28
    Assert::same("en", $this->resolver->resolve());
29
  }
30
}
31
32
$test = new ChainLocaleResolverTest();
33
$test->run();
34
?>