Beispiel #1
0
 public static function setUpBeforeClass()
 {
     self::$is_check_timeline_view_cache = is_enabled('timeline') && \Config::get('timeline.articles.cache.is_use');
     self::$is_check_notice_cache = is_enabled('notice') && \Config::get('notice.cache.unreadCount.isEnabled');
     self::$member = \Model_Member::check_authority(self::$member_id);
     self::$album_image = \Album\Site_Test::setup_album_image(self::$member_id, null, 1);
     self::$album = Model_Album::find(self::$album_image->album_id);
     self::$album_image_comment = \Site_Test::save_comment('album_image', self::$album_image->id, self::$member_id);
     Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => self::$album_image->id, 'member_id' => 2));
     Model_AlbumImageCommentLike::change_registered_status4unique_key(array('album_image_comment_id' => self::$album_image_comment->id, 'member_id' => 3));
     \Site_Test::save_comment('album_image', self::$album_image->id, 2);
     \Site_Test::save_comment('album_image', self::$album_image->id, 3);
 }
 public function test_delete_notice()
 {
     // 事前準備
     $config_type_key = 'like';
     \Model_MemberConfig::set_value(1, \Notice\Form_MemberConfig::get_name('comment'), 0);
     \Model_MemberConfig::set_value(2, \Notice\Form_MemberConfig::get_name($config_type_key), 1);
     \Model_MemberConfig::set_value(2, \Notice\Site_Util::get_member_config_name_for_watch_content('comment'), 0);
     self::$member_id = 1;
     self::$timeline = Site_Test::setup_timeline(self::$member_id);
     self::$timeline_comment = \Site_Test::save_comment('timeline', self::$timeline->id, 2);
     $notice_count_all_before = \Notice\Model_Notice::get_count();
     $notice_status_count_all_before = \Notice\Model_NoticeStatus::get_count();
     $notice_member_from_count_all_before = \Notice\Model_NoticeMemberFrom::get_count();
     // イイね実行
     $is_liked = (bool) Model_TimelineCommentLike::change_registered_status4unique_key(array('timeline_comment_id' => self::$timeline_comment->id, 'member_id' => 4));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline_comment->id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // 件数確認
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     // 関連テーブルのレコードが作成されていることを確認
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice->id));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 4));
     $this->assertNotNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline_comment->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // イイねを取り消し
     $is_liked = (bool) Model_TimelineCommentLike::change_registered_status4unique_key(array('timeline_comment_id' => self::$timeline_comment->id, 'member_id' => 4));
     // 件数確認
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     // 関連テーブルのレコードが削除されていることを確認
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 4));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline_comment->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // イイね実行
     $is_liked = (bool) Model_TimelineCommentLike::change_registered_status4unique_key(array('timeline_comment_id' => self::$timeline_comment->id, 'member_id' => 4));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline_comment->id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // timeline_comment 削除
     self::$timeline_comment->delete();
     // 件数確認
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     // 再度 comment 投稿
     self::$timeline_comment = \Site_Test::save_comment('timeline', self::$timeline->id, 2);
     // イイね実行
     $is_liked = (bool) Model_TimelineCommentLike::change_registered_status4unique_key(array('timeline_comment_id' => self::$timeline_comment->id, 'member_id' => 4));
     // 件数確認
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     // timeline 削除
     self::$timeline->delete();
     // 件数確認
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     // 関連テーブルのレコードが削除されていることを確認
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 4));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline_comment->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
 }
Beispiel #3
0
 public function test_delete_notice()
 {
     // 事前準備
     \Model_MemberConfig::set_value(2, \Notice\Form_MemberConfig::get_name(self::$type_key), 1);
     \Model_MemberConfig::set_value(2, \Notice\Site_Util::get_member_config_name_for_watch_content(self::$type_key), 1);
     \Model_MemberConfig::set_value(3, \Notice\Form_MemberConfig::get_name(self::$type_key), 1);
     \Model_MemberConfig::set_value(3, \Notice\Site_Util::get_member_config_name_for_watch_content(self::$type_key), 1);
     self::$member_id = 1;
     self::$timeline = Site_Test::setup_timeline(self::$member_id);
     $notice_count_all_before = \Notice\Model_Notice::get_count();
     $notice_status_count_all_before = \Notice\Model_NoticeStatus::get_count();
     $notice_member_from_count_all_before = \Notice\Model_NoticeMemberFrom::get_count();
     $member_watch_content_count_all_before = \Notice\Model_MemberWatchContent::get_count();
     // 他人がイイね
     $timeline_like_id = Model_TimelineLike::change_registered_status4unique_key(array('timeline_id' => self::$timeline->id, 'member_id' => 2));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // 件数確認
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // 関連テーブルのレコードが作成されていることを確認
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 2));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, 2));
     $this->assertNotNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // イイねを取り消し
     $timeline_like_id = Model_TimelineLike::change_registered_status4unique_key(array('timeline_id' => self::$timeline->id, 'member_id' => 2));
     // 件数確認
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // watch は解除されない
     // 関連テーブルのレコードが削除されていることを確認
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 2));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, 2));
     // watch は解除されない
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // 他人のイイね+自分がコメント
     $timeline_like_id = Model_TimelineLike::change_registered_status4unique_key(array('timeline_id' => self::$timeline->id, 'member_id' => 2));
     \Site_Test::save_comment('timeline', self::$timeline->id, 1);
     $notice_like = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $notice_comment = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type('comment'));
     $this->assertNotNull($notice_like);
     $this->assertNotNull($notice_comment);
     // 件数確認
     $this->assertEquals($notice_count_all_before + 2, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 2, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 2, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // 関連テーブルのレコードが作成されていることを確認
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice_comment->id));
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice_like->id));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_like->id, 2));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_comment->id, self::$member_id));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, 2));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, self::$member_id));
     $this->assertNotNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // イイねを取り消し
     $timeline_like_id = Model_TimelineLike::change_registered_status4unique_key(array('timeline_id' => self::$timeline->id, 'member_id' => 2));
     // 件数確認
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // watch は解除されない
     // 関連テーブルのレコードが削除されていることを確認
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice_comment->id));
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice_like->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_like->id, 2));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_comment->id, self::$member_id));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, 2));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, self::$member_id));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // 他人がイイね
     $timeline_like_id = Model_TimelineLike::change_registered_status4unique_key(array('timeline_id' => self::$timeline->id, 'member_id' => 3));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // timeline 削除
     self::$timeline->delete();
     // 件数確認
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before, \Notice\Model_MemberWatchContent::get_count());
     // 関連テーブルのレコードが削除されていることを確認
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 3));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, self::$timeline->id, 3));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, self::$timeline->id, \Notice\Site_Util::get_notice_type(self::$type_key)));
 }
Beispiel #4
0
 public function test_delete_notice()
 {
     // 事前準備
     \Model_MemberConfig::set_value(2, \Notice\Form_MemberConfig::get_name(self::$type_key), 1);
     \Model_MemberConfig::set_value(2, \Notice\Site_Util::get_member_config_name_for_watch_content(self::$type_key), 1);
     \Model_MemberConfig::set_value(3, \Notice\Form_MemberConfig::get_name(self::$type_key), 1);
     \Model_MemberConfig::set_value(3, \Notice\Site_Util::get_member_config_name_for_watch_content(self::$type_key), 1);
     self::$member_id = 1;
     self::$album_image = \Album\Site_Test::setup_album_image(self::$member_id, null, 1);
     self::$album = Model_Album::find(self::$album_image->album_id);
     $album_image_id = self::$album_image->id;
     $foreign_id = self::$album_image->id;
     $notice_count_all_before = \Notice\Model_Notice::get_count();
     $notice_status_count_all_before = \Notice\Model_NoticeStatus::get_count();
     $notice_member_from_count_all_before = \Notice\Model_NoticeMemberFrom::get_count();
     $member_watch_content_count_all_before = \Notice\Model_MemberWatchContent::get_count();
     // liked from others.
     $like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 2));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // check count
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // check created related table records.
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 2));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 2));
     $this->assertNotNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // undo like.
     $like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 2));
     // check count
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // keep watched
     // check deleted related table records.
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 2));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 2));
     // keep watched
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // others execute like and coment myself.
     $album_image_like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 2));
     \Site_Test::save_comment('album_image', $album_image_id, 1, 'Test comment1.');
     $notice_like = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $notice_comment = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type('comment'));
     $this->assertNotNull($notice_like);
     $this->assertNotNull($notice_comment);
     // check count
     $this->assertEquals($notice_count_all_before + 2, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 2, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 2, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // check created related table records.
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice_comment->id));
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice_like->id));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_like->id, 2));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_comment->id, self::$member_id));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 2));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, self::$member_id));
     $this->assertNotNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // undo like.
     $like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 2));
     // check count
     $this->assertEquals($notice_count_all_before + 1, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before + 1, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before + 1, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before + 1, \Notice\Model_MemberWatchContent::get_count());
     // keep watch
     // check created related table records.
     $this->assertNotNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(2, $notice_comment->id));
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice_like->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_like->id, 2));
     $this->assertNotNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice_comment->id, self::$member_id));
     $this->assertNotNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 2));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, self::$member_id));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // others execute like.
     $album_image_like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 3));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // delete album_image.
     $album_image = Model_AlbumImage::find($album_image_id);
     $album_image->delete();
     // check count
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before, \Notice\Model_MemberWatchContent::get_count());
     // check deleted related table records.
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 3));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 3));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
     // album delete test
     // setup
     self::$album_image = \Album\Site_Test::setup_album_image(self::$member_id, null, 1, self::$album->id);
     $foreign_id = self::$album_image->id;
     $album_image_id = self::$album_image->id;
     // others execute like.
     $album_image_like_id = Model_AlbumImageLike::change_registered_status4unique_key(array('album_image_id' => $album_image_id, 'member_id' => 4));
     $notice = \Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key));
     $this->assertNotNull($notice);
     // delete album_image
     self::$album->delete();
     // check count
     $this->assertEquals($notice_count_all_before, \Notice\Model_Notice::get_count());
     $this->assertEquals($notice_status_count_all_before, \Notice\Model_NoticeStatus::get_count());
     $this->assertEquals($notice_member_from_count_all_before, \Notice\Model_NoticeMemberFrom::get_count());
     $this->assertEquals($member_watch_content_count_all_before, \Notice\Model_MemberWatchContent::get_count());
     // check deleted related table records.
     $this->assertNull(\Notice\Model_NoticeStatus::get4member_id_and_notice_id(self::$member_id, $notice->id));
     $this->assertNull(\Notice\Model_NoticeMemberFrom::get4notice_id_and_member_id($notice->id, 3));
     $this->assertNull(\Notice\Model_MemberWatchContent::get_one4foreign_data_and_member_id(self::$foreign_table, $album_image_id, 3));
     $this->assertNull(\Notice\Model_Notice::get_last4foreign_data(self::$foreign_table, $album_image_id, \Notice\Site_Util::get_notice_type(self::$type_key)));
 }