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

MessageSelectorTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Translation;
5
6
require __DIR__ . "/../../bootstrap.php";
7
8
use Tester\Assert;
9
10
/**
11
 * MessageSelectorTest
12
 *
13
 * @author Jakub Konečný
14
 * @testCase
15
 */
16
final class MessageSelectorTest extends \Tester\TestCase {
17
  protected MessageSelector $messageSelector;
18
  
19
  public function setUp(): void {
20
    $this->messageSelector = new MessageSelector();
21
  }
22
  
23
  public function testIsMultiChoice(): void {
24
    Assert::false($this->messageSelector->isMultiChoice("abc"));
25
    Assert::true($this->messageSelector->isMultiChoice("{0}abc|{1}def"));
26
  }
27
  
28
  public function testChoose(): void {
29
    $message = "abc";
30
    Assert::same($message, $this->messageSelector->choose($message, 0));
31
    Assert::same("abc", $this->messageSelector->choose("{0}abc|{1}def", 0));
32
  }
33
}
34
35
$test = new MessageSelectorTest();
36
$test->run();
37
?>