@@ 156-170 (lines=15) @@ | ||
153 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
154 | } |
|
155 | ||
156 | public function testUpdatePopulatedPost() |
|
157 | { |
|
158 | $post = Post::find()->multilingual()->where(['id' => 2])->one(); |
|
159 | $post->setAttributes([ |
|
160 | 'title' => 'Updated post title 2', |
|
161 | 'body' => 'Updated post body 2', |
|
162 | 'title_en' => 'Updated post title 2 en', |
|
163 | 'body_en' => 'Updated post body 2 en', |
|
164 | ]); |
|
165 | ||
166 | $this->assertTrue($post->save()); |
|
167 | $dataSet = $this->getConnection()->createDataSet(['post', 'postLang']); |
|
168 | $expectedDataSet = $this->createFlatXMLDataSet(__DIR__ . '/data/test-update-populated-post.xml'); |
|
169 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
170 | } |
|
171 | ||
172 | public function testLocalized() |
|
173 | { |
@@ 80-94 (lines=15) @@ | ||
77 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
78 | } |
|
79 | ||
80 | public function testUpdatePopulatedPost() |
|
81 | { |
|
82 | $post = Post::find()->multilingual()->where(['id' => 2])->one(); |
|
83 | $post->setAttributes([ |
|
84 | 'title' => 'Updated post title 2', |
|
85 | 'body' => 'Updated post body 2', |
|
86 | 'title_en_us' => 'Updated post title 2 en', |
|
87 | 'body_en_us' => 'Updated post body 2 en', |
|
88 | ]); |
|
89 | ||
90 | $this->assertTrue($post->save()); |
|
91 | $dataSet = $this->getConnection()->createDataSet(['post', 'postLang']); |
|
92 | $expectedDataSet = $this->createFlatXMLDataSet(__DIR__ . '/data/test-update-populated-post-na.xml'); |
|
93 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
94 | } |
|
95 | ||
96 | public function testLocalized() |
|
97 | { |