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()); }
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()); }