<commit_before><?php

use DirCommander\DirCommander;
use DirCommander\Adapters\LocalDirCommanderAdapter;

/**
 * Created by JetBrains PhpStorm.
 * User: Alexander
 * Date: 02.10.12
 * Time: 17:40
 * To change this template use File | Settings | File Templates.
 */

class FileSystemLocalTest extends PHPUnit_Framework_TestCase {

  const DS = DIRECTORY_SEPARATOR;

  /**
   * @var DirCommander
   */
  private $dc;

  /**
   * @var string
   */
  private $testDir;

  /**
   * @var string
   */
  private $assertDir;

  /**
   * @var string
   */
  private static $testingAssrtsDir;


  public static function setUpBeforeClass() {
	
	self::$testingAssrtsDir = __DIR__ . self::DS . 'assert';

	if(!mkdir(self::$testingAssrtsDir)) {
      new Exception('Can`t create testing asserts dir');
    }

  }

  public static function tearDownAfterClass() {
	
	if(!rmdir(self::$testingAssrtsDir)) {
      new Exception('Can`t delete testing asserts dir');
    }

  }

  /**
   *
   */
  protected function setUp(){

    $this->testDir = time();
    $this->assertDir = _self::$testingAssrtsDir . self::DS . $this->testDir;
	
    if(!mkdir($this->assertDir)) {
      new Exception('Can`t create assert dir');
    }

    $this->dc = new DirCommander(new LocalDirCommanderAdapter(), $this->assertDir);
  }

  /**
   *
   */
  protected function tearDown(){

    if(!$this->delete($this->assertDir)) {
      new Exception('Can`t remove assert dir');
    }

  }

  /**
   * Recursive file delete
   *
   * @param $path
   *
   * @return bool<commit_msg>Fix typo in "self" word<commit_after><?php

use DirCommander\DirCommander;
use DirCommander\Adapters\LocalDirCommanderAdapter;

/**
 * Created by JetBrains PhpStorm.
 * User: Alexander
 * Date: 02.10.12
 * Time: 17:40
 * To change this template use File | Settings | File Templates.
 */

class FileSystemLocalTest extends PHPUnit_Framework_TestCase {

  const DS = DIRECTORY_SEPARATOR;

  /**
   * @var DirCommander
   */
  private $dc;

  /**
   * @var string
   */
  private $testDir;

  /**
   * @var string
   */
  private $assertDir;

  /**
   * @var string
   */
  private static $testingAssrtsDir;


  public static function setUpBeforeClass() {
	
	self::$testingAssrtsDir = __DIR__ . self::DS . 'assert';

	if(!mkdir(self::$testingAssrtsDir)) {
      new Exception('Can`t create testing asserts dir');
    }

  }

  public static function tearDownAfterClass() {
	
	if(!rmdir(self::$testingAssrtsDir)) {
      new Exception('Can`t delete testing asserts dir');
    }

  }

  /**
   *
   */
  protected function setUp(){

    $this->testDir = time();
    $this->assertDir = self::$testingAssrtsDir . self::DS . $this->testDir;
	
    if(!mkdir($this->assertDir)) {
      new Exception('Can`t create assert dir');
    }

    $this->dc = new DirCommander(new LocalDirCommanderAdapter(), $this->assertDir);
  }

  /**
   *
   */
  protected function tearDown(){

    if(!$this->delete($this->assertDir)) {
      new Exception('Can`t remove assert dir');
    }

  }

  /**
   * Recursive file delete
   *
   * @param $path
   *
   * @return bool
{'fraction_non_alphanumeric': 0.1440155692507298, 'fraction_numerical': 0.006487187804086928, 'mean_word_length': 2.958921694480103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '922179', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1006, 'n_words': 223}