Ejemplo n.º 1
0
 public function testConvertStr()
 {
     // Note: This convert is entirely "in PHP" so go ahead and test out the full process without stubbing out cmd()
     $render3d = new Render3d();
     $name = 'example';
     $render3d->workingDir($this->workingDir);
     $render3d->file($name);
     $render3d->fileType('stl');
     copy($this->testFilesDir . $name . '.stl', $this->workingDir . $name . '.stl');
     $converter = new StlPov($render3d);
     $currentDir = getcwd();
     chdir($this->workingDir);
     $converter->convert(true);
     chdir($currentDir);
     // Make sure it updated the file type when successful
     $this->assertEquals('pov', $render3d->fileType(), 'Ensure that the file type was updated when convert successful');
     $this->assertEquals($name, $render3d->file(), 'Ensure that the filename stayed the same for consistency');
     $this->assertFileExists($this->workingDir . $name . '.pov', 'Ensure that the pov file was created');
 }
Ejemplo n.º 2
0
 public function testFile()
 {
     // Without seeing anything, file should be empty
     $this->assertEmpty($this->render3d->file());
     $this->assertEquals('file1', $this->render3d->file('file1'));
     // make sure it retains value
     $this->assertEquals('file1', $this->render3d->file());
     $this->render3d->file('file2');
     $this->assertEquals('file2', $this->render3d->file());
 }