/**
  * @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);
 }
Пример #2
0
 public function testPrepareOnCustomGetMethod()
 {
     $user = new YearFavoriteAlbum(array('email' => '*****@*****.**', 'year' => '2009', 'position' => 1));
     $this->assertEquals('<em>&quot;09&quot;</em>', $user->prepareTwoDigitYear());
 }