@@ 140-154 (lines=15) @@ | ||
137 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
138 | } |
|
139 | ||
140 | public function testUpdateNotPopulatedPost() |
|
141 | { |
|
142 | $post = Post::findOne(2); |
|
143 | $post->setAttributes([ |
|
144 | 'title' => 'Updated post title 2', |
|
145 | 'body' => 'Updated post body 2', |
|
146 | 'title_en' => 'Updated post title 2 en', |
|
147 | 'body_en' => 'Updated post title 2 en', |
|
148 | ]); |
|
149 | ||
150 | $this->assertTrue($post->save()); |
|
151 | $dataSet = $this->getConnection()->createDataSet(['post', 'postLang']); |
|
152 | $expectedDataSet = $this->createFlatXMLDataSet(__DIR__ . '/data/test-update-not-populated-post.xml'); |
|
153 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
154 | } |
|
155 | ||
156 | public function testUpdatePopulatedPost() |
|
157 | { |
@@ 64-78 (lines=15) @@ | ||
61 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
62 | } |
|
63 | ||
64 | public function testUpdateNotPopulatedPost() |
|
65 | { |
|
66 | $post = Post::findOne(2); |
|
67 | $post->setAttributes([ |
|
68 | 'title' => 'Updated post title 2', |
|
69 | 'body' => 'Updated post body 2', |
|
70 | 'title_en_us' => 'Updated post title 2 en', |
|
71 | 'body_en_us' => 'Updated post title 2 en', |
|
72 | ]); |
|
73 | ||
74 | $this->assertTrue($post->save()); |
|
75 | $dataSet = $this->getConnection()->createDataSet(['post', 'postLang']); |
|
76 | $expectedDataSet = $this->createFlatXMLDataSet(__DIR__ . '/data/test-update-not-populated-post-na.xml'); |
|
77 | $this->assertDataSetsEqual($expectedDataSet, $dataSet); |
|
78 | } |
|
79 | ||
80 | public function testUpdatePopulatedPost() |
|
81 | { |