function testCreateEnvironmentWithCompressors() { $config = new Config(array('js_compressor' => 'uglify_js', 'css_compressor' => 'yuglify_css')); $env = $config->createEnvironment(); $this->assertTrue($env->bundleProcessors->isRegistered($env->contentType('.js'), $env->compressors['uglify_js'])); $this->assertTrue($env->bundleProcessors->isRegistered($env->contentType('.css'), $env->compressors['yuglify_css'])); }
private function __construct() { $this->config = Config::instance(); }
/** * Table constructor. Returns instance of Pipe\Table to query against. If the table does not * exist a PDOException is thrown. * * @param string $name Name of table * @throws PDOException * @throws PipeException * @return Pipe\Table */ public function __construct($name) { if (!is_string($name) || strlen($name) === 0) { throw new PipeException("Invalid table name specified"); } $this->table = $name; $this->config = Config::instance(); $this->connection = Connection::instance()->pdo; $this->sql = new SQL($name); //Check table exists //Do this trying to get column details $this->columns = $this->columns(); //Make sure table has an `ID` field, Pipe needs this to work if (!in_array('id', $this->columns)) { throw new PipeException("Table `{$name}` must contain an `id` column"); } }