Esempio n. 1
0
 public function testUploadScreenshot()
 {
     $p = new Project($this->container);
     $f = new File($this->container);
     $tc = new TaskCreation($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'test')));
     $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'test')));
     $this->assertEquals(1, $f->uploadScreenshot(1, 1, base64_encode('image data')));
     $file = $f->getById(1);
     $this->assertNotEmpty($file);
     $this->assertStringStartsWith('Screenshot taken ', $file['name']);
     $this->assertStringStartsWith('1/1/', $file['path']);
     $this->assertEquals(1, $file['is_image']);
     $this->assertEquals(1, $file['task_id']);
     $this->assertEquals(time(), $file['date'], '', 2);
     $this->assertEquals(0, $file['user_id']);
     $this->assertEquals(10, $file['size']);
 }