/** * @dataProvider deleteThreeColumnProvider */ public function testDeleteThreeColumn($email, $year, $album_id, $resulting_order) { $favorite_album = new YearFavoriteAlbum(array('email' => $email, 'year' => $year, 'album_id' => $album_id)); $favorite_album->delete(); $expected_result = array(); foreach ($resulting_order as $index => $album_id) { $expected_result[] = array('email' => $email, 'position' => $index + 1, 'album_id' => $album_id); } $actual_result = self::$db->translatedQuery("SELECT email, position, album_id FROM year_favorite_albums WHERE email = %s ORDER BY position ASC", $email)->fetchAllRows(); $this->assertEquals($expected_result, $actual_result); }
public function testPrepareOnCustomGetMethod() { $user = new YearFavoriteAlbum(array('email' => '*****@*****.**', 'year' => '2009', 'position' => 1)); $this->assertEquals('<em>"09"</em>', $user->prepareTwoDigitYear()); }