| @@ 100-123 (lines=24) @@ | ||
| 97 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\Gateway\DoctrineDatabase::updateLanguage |
|
| 98 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\Gateway\DoctrineDatabase::setCommonLanguageColumns |
|
| 99 | */ |
|
| 100 | public function testUpdateLanguage() |
|
| 101 | { |
|
| 102 | $gateway = $this->getDatabaseGateway(); |
|
| 103 | ||
| 104 | $language = $this->getLanguageFixture(); |
|
| 105 | $language->id = 2; |
|
| 106 | ||
| 107 | $gateway->updateLanguage($language); |
|
| 108 | ||
| 109 | $this->assertQueryResult( |
|
| 110 | array( |
|
| 111 | array( |
|
| 112 | 'id' => '2', |
|
| 113 | 'locale' => 'de-DE', |
|
| 114 | 'name' => 'Deutsch (Deutschland)', |
|
| 115 | 'disabled' => '0', |
|
| 116 | ), |
|
| 117 | ), |
|
| 118 | $this->getDatabaseHandler()->createSelectQuery() |
|
| 119 | ->select('id', 'locale', 'name', 'disabled') |
|
| 120 | ->from('ezcontent_language') |
|
| 121 | ->where('id=2') |
|
| 122 | ); |
|
| 123 | } |
|
| 124 | ||
| 125 | /** |
|
| 126 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\Gateway\DoctrineDatabase::loadLanguageListData |
|
| @@ 56-77 (lines=22) @@ | ||
| 53 | /** |
|
| 54 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::insertSection |
|
| 55 | */ |
|
| 56 | public function testInsertSection() |
|
| 57 | { |
|
| 58 | $gateway = $this->getDatabaseGateway(); |
|
| 59 | ||
| 60 | $gateway->insertSection('New Section', 'new_section'); |
|
| 61 | $query = $this->getDatabaseHandler()->createSelectQuery(); |
|
| 62 | ||
| 63 | $this->assertQueryResult( |
|
| 64 | array( |
|
| 65 | array( |
|
| 66 | 'id' => '7', |
|
| 67 | 'identifier' => 'new_section', |
|
| 68 | 'name' => 'New Section', |
|
| 69 | 'locale' => '', |
|
| 70 | ), |
|
| 71 | ), |
|
| 72 | $query |
|
| 73 | ->select('id', 'identifier', 'name', 'locale') |
|
| 74 | ->from('ezsection') |
|
| 75 | ->where($query->expr->eq('identifier', $query->bindValue('new_section'))) |
|
| 76 | ); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::updateSection |
|