本文整理匯總了PHP中Teacher::documents方法的典型用法代碼示例。如果您正苦於以下問題:PHP Teacher::documents方法的具體用法?PHP Teacher::documents怎麽用?PHP Teacher::documents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Teacher
的用法示例。
在下文中一共展示了Teacher::documents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testDocuments
function testDocuments()
{
$x = new Teacher(2);
$y = $x->documents();
$d = array_shift($y);
$this->assertType('Document', $d);
$this->assertEquals('Willy_Wonka-Rhyming_Dictionary.doc', $d->url());
}
示例2: testDocumentAdd
function testDocumentAdd()
{
$d = new Document(false);
$set = array('teacher_id' => 1, 'mediatype' => 'wma', 'url' => 'newsong.wma', 'description' => 'new song', 'pricecode' => 'b');
$new_id = $d->add($set);
$d = new Document($new_id);
$d->add_teacher($set['teacher_id']);
$this->assertEquals($set['description'], $d->description());
$t = new Teacher($set['teacher_id']);
$ds = $t->documents();
$this->assertType('array', $ds);
$this->assertArrayHasKey($new_id, $ds);
$d = $ds[$new_id];
$this->assertEquals($set['description'], $d->description());
}