App\Lib\Test::init PHP Method

init() public method

Initialization of the Test
public init ( string $type, object $file )
$type string Type of Test
$file object File for the Test
    public function init($type, $file)
    {
        $filename = $this->filterFileName($file->getFileName());
        $posTypePath = strpos($file->getPathname(), DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR) + strlen(DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR);
        $this->hash = $this->makeHash($type . $filename);
        $this->title = $this->filterTitle($filename);
        $this->filename = substr($file->getPathname(), $posTypePath);
        $this->file = $file;
        $this->type = $type;
        $this->state = self::STATE_READY;
        // Not used yet.
    }