private static function set_note() { $note = \Note\Model_Note::forge(); $values = array('title' => 'test', 'body' => 'This is test.', 'public_flag' => FBD_PUBLIC_FLAG_ALL); $note->save_with_relations(self::$member_id, $values); self::$note_id = $note->id; return $note; }
public function update_public_flag_with_relations_provider() { $data = array(); $note = \Note\Model_Note::forge(); $values = array('title' => 'test', 'body' => 'This is test.', 'public_flag' => FBD_PUBLIC_FLAG_ALL); $note->save_with_relations(1, $values); $data[] = array(FBD_PUBLIC_FLAG_MEMBER); // 変更なし $data[] = array(FBD_PUBLIC_FLAG_MEMBER); return $data; }
public static function get_foreign_table_obj($type, $foreign_id) { switch ($type) { case \Config::get('timeline.types.note'): return \Note\Model_Note::find($foreign_id); case \Config::get('timeline.types.thread'): return \thread\Model_thread::find($foreign_id); case \Config::get('timeline.types.album'): case \Config::get('timeline.types.album_image'): case \Config::get('timeline.types.album_image_timeline'): return \Album\Model_Album::find($foreign_id); } return null; }
public function test_check_type_note() { if (!($list = Model_Timeline::get4type_key('note'))) { \Util_Develop::output_test_info(__FILE__, __LINE__); $this->markTestSkipped('No record for test.'); } foreach ($list as $obj) { // check for reference data. $this->assertEquals('note', $obj->foreign_table); $note = \Note\Model_Note::check_authority($obj->foreign_id); $this->assertNotEmpty($note); $member = \Model_Member::check_authority($obj->member_id); $this->assertNotEmpty($member); // check for member_id $this->assertEquals($note->member_id, $obj->member_id); // check for public_flag. $this->assertEquals($note->public_flag, $obj->public_flag); // 未使用カラムの値が null か $this->assertEmpty($obj->body); } }