private function __construct($name, Spritable $spritable) { $this->LOGGER = PsLogger::inst(__CLASS__); $this->spritable = $spritable; $this->name = $name; $this->cssDi = self::autogenWs($name)->getDirItem(null, $name, 'css'); $this->imgDi = self::autogenWs($name)->getDirItem(null, $name, PsImg::getExt(SYSTEM_IMG_TYPE)); $this->LOGGER->info("INSTANCE CREATED FOR [{$name}]"); $this->rebuild(false); }
/** * @covers PsImg::getExt */ public function testGetExt() { $this->assertEquals('png', PsImg::getExt('png')); $this->assertEquals('png', PsImg::getExt('image/png')); $this->assertEquals('png', PsImg::getExt(IMAGETYPE_PNG)); $this->assertEquals('gif', PsImg::getExt('gif')); $this->assertEquals('gif', PsImg::getExt('image/gif')); $this->assertEquals('gif', PsImg::getExt(IMAGETYPE_GIF)); $this->assertEquals('jpg', PsImg::getExt('jpg')); $this->assertEquals('jpeg', PsImg::getExt('jpeg')); $this->assertEquals('jpeg', PsImg::getExt('image/jpeg')); $this->assertEquals('jpeg', PsImg::getExt(IMAGETYPE_JPEG)); try { PsImg::getExt(self::NOT_ALLOWED_INT); $this->brakeNoException(); } catch (PException $ex) { } try { PsImg::getExt(null); $this->brakeNoException(); } catch (PException $ex) { } }