We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 35 | class Hyphenator_Cache_Test extends PHP_Typography_Testcase { |
||
| 36 | /** |
||
| 37 | * Hyphenator_Cache fixture. |
||
| 38 | * |
||
| 39 | * @var \PHP_Typography\Hyphenator_Cache|null |
||
| 40 | */ |
||
| 41 | protected $c; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Sets up the fixture, for example, opens a network connection. |
||
| 45 | * This method is called before a test is executed. |
||
| 46 | */ |
||
| 47 | protected function setUp() { |
||
| 48 | $this->c = new \PHP_Typography\Hyphenator_Cache(); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Tears down the fixture, for example, closes a network connection. |
||
| 53 | * This method is called after a test is executed. |
||
| 54 | */ |
||
| 55 | protected function tearDown() { |
||
| 56 | $this->c = null; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Tests set_hyphenator. |
||
| 61 | * |
||
| 62 | * @covers ::set_hyphenator |
||
| 63 | * @covers ::get_hyphenator |
||
| 64 | */ |
||
| 65 | public function test_hyphenator_cache() { |
||
| 66 | $hyphenator = new \PHP_Typography\Hyphenator(); |
||
| 67 | |||
| 68 | $this->assertSame( null, $this->c->get_hyphenator( 'de' ) ); |
||
| 69 | $this->c->set_hyphenator( 'de', $hyphenator ); |
||
| 70 | $this->assertSame( $hyphenator, $this->c->get_hyphenator( 'de' ) ); |
||
| 71 | $this->assertSame( null, $this->c->get_hyphenator( 'foobar' ) ); |
||
| 72 | } |
||
| 73 | } |
||
| 74 |