public function testConstructor() { $o = $this->basicObjectFixture(); $this->assertEquals(self::FNAME, $o->name()); $o = new Object('a', 'b', 'text/plain'); $this->assertEquals('a', $o->name()); $this->assertEquals('b', $o->content()); $this->assertEquals('text/plain', $o->contentType()); }
public function testSave() { // Clean up anything left. $this->destroyContainerFixture(); $container = $this->containerFixture(); $obj = new Object(self::FNAME, self::FCONTENT, self::FTYPE); $obj->setMetadata(array('foo' => '1234')); $this->assertEquals(self::FCONTENT, $obj->content()); try { $ret = $container->save($obj); } catch (\Exception $e) { $this->destroyContainerFixture(); throw $e; } $this->assertTrue($ret); }