You are here

function ContentAccessTestCase::debugCurrentPage in Content Access 5

Stores the current page in the files directory, so it can be viewed by the developer. Useful for debugging code.

File

tests/content_access_test_help.php, line 141
Helper class with auxiliary functions for content access module tests

Class

ContentAccessTestCase
@file Helper class with auxiliary functions for content access module tests

Code

function debugCurrentPage() {
  static $count = 0;
  $count++;
  $path = 'tests';
  if (!file_check_directory($path, FILE_CREATE_DIRECTORY)) {
    return FALSE;

    //unable to create directory
  }
  $filepath = file_create_filename("page-{$count}.htm", $path);
  file_put_contents($filepath, $this
    ->drupalGetContent());
  echo '<a href="' . $filepath . '">created debug file ' . $count . '</a><br/>';

  //echo l("created debug file $count", $filepath);
}