Beispiel #1
0
 /**
  *
  * @return array
  */
 public function shoot()
 {
     $this->_session = $this->_camera->get_session();
     // Iterate over shots
     foreach ($this->_shots as $shot) {
         /* @var $shot Shot */
         $output = $this->_shoot_shot($shot);
         $this->_log_out("Saving as " . $this->_film->get_root_folder() . $shot->get_destination_file());
         // Save output in folder
         if (empty($output)) {
             $this->_log_out("There was an error capturing this page. Please, check or retry. ");
             continue;
         }
         $saved_result = $this->_film->get_filesystem()->put($shot->get_destination_file(), $output);
         if (!$saved_result) {
             $this->_log_out("There was an error saving the screenshot. Please, check or retry. ");
             continue;
         }
         // It was successful, mark it
         $shot->set_completed(true);
     }
     // If session is open (it should) just close it
     if ($this->_session->isStarted()) {
         $this->_session->stop();
     }
     return $this->_shots;
 }
Beispiel #2
0
 /**
  * @covers Pachico\Voyeur\Film::__construct
  * @covers Pachico\Voyeur\Film::get_root_folder
  */
 public function testGet_root_folder()
 {
     $this->assertSame(TEST_PICTURE_FOLDER, $this->_storage->get_root_folder());
     $this->_storage = new Film(TEST_PICTURE_FOLDER . '///');
     $this->assertSame(TEST_PICTURE_FOLDER, $this->_storage->get_root_folder());
 }