Esempio n. 1
0
 /**
  * Pauses test execution in debug mode.
  * To proceed test press "ENTER" in console.
  *
  * This method is useful while writing tests, since it allows you to inspect the current page in the middle of a test case.
  */
 public function pauseExecution()
 {
     Debug::pause();
 }
Esempio n. 2
0
 /**
  * Checks if file exists in path.
  * Opens a file when it's exists
  *
  * ``` php
  * <?php
  * $I->seeFileFound('UserModel.php','app/models');
  * ?>
  * ```
  *
  * @param $filename
  * @param string $path
  */
 public function seeFileFound($filename, $path = '')
 {
     if (file_exists($filename) and !$path) {
         $this->openFile($filename);
         $this->filepath = $filename;
         $this->debug($filename);
         \PHPUnit_Framework_Assert::assertFileExists($path . $filename);
         return;
     }
     $path = $this->absolutizePath($path);
     $this->debug($path);
     if (!file_exists($path)) {
         \PHPUnit_Framework_Assert::fail("Directory does not exist: {$path}");
     }
     $files = Finder::create()->files()->name($filename)->in($path);
     foreach ($files as $file) {
         $file = $file->getRealPath();
         $this->openFile($file);
         $this->filepath = $file;
         $this->debug($file);
         \PHPUnit_Framework_Assert::assertFileExists($file);
         return;
     }
     \Codeception\Util\Debug::pause();
     $this->fail("{$filename} in {$path}");
 }