|
@@ 157-173 (lines=17) @@
|
| 154 |
|
/** |
| 155 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler::load |
| 156 |
|
*/ |
| 157 |
|
public function testLoad() |
| 158 |
|
{ |
| 159 |
|
$handler = $this->getLanguageHandler(); |
| 160 |
|
$cacheMock = $this->getLanguageCacheMock(); |
| 161 |
|
|
| 162 |
|
$cacheMock->expects($this->once()) |
| 163 |
|
->method('get') |
| 164 |
|
->with($this->equalTo('ez-language-2')) |
| 165 |
|
->willReturn($this->getLanguageFixture()); |
| 166 |
|
|
| 167 |
|
$result = $handler->load(2); |
| 168 |
|
|
| 169 |
|
$this->assertEquals( |
| 170 |
|
$this->getLanguageFixture(), |
| 171 |
|
$result |
| 172 |
|
); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
/** |
| 176 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler::load |
|
@@ 205-221 (lines=17) @@
|
| 202 |
|
/** |
| 203 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler::loadByLanguageCode |
| 204 |
|
*/ |
| 205 |
|
public function testLoadByLanguageCode() |
| 206 |
|
{ |
| 207 |
|
$handler = $this->getLanguageHandler(); |
| 208 |
|
$cacheMock = $this->getLanguageCacheMock(); |
| 209 |
|
|
| 210 |
|
$cacheMock->expects($this->once()) |
| 211 |
|
->method('get') |
| 212 |
|
->with($this->equalTo('ez-language-code-eng-US')) |
| 213 |
|
->willReturn($this->getLanguageFixture()); |
| 214 |
|
|
| 215 |
|
$result = $handler->loadByLanguageCode('eng-US'); |
| 216 |
|
|
| 217 |
|
$this->assertEquals( |
| 218 |
|
$this->getLanguageFixture(), |
| 219 |
|
$result |
| 220 |
|
); |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
/** |
| 224 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler::loadByLanguageCode |