/** * @return void */ protected function setUp() { $this->slir = new SLIR(); SLIRConfig::$defaultImagePath = null; SLIRConfig::$forceQueryString = false; SLIRConfig::$enableErrorImages = false; SLIRConfig::$defaultCropper = SLIR::CROP_CLASS_CENTERED; SLIRConfig::$copyEXIF = false; SLIRConfig::$maxMemoryToAllocate = -1; // Try to fix documentRoot for CLI SLIRConfig::$documentRoot = realpath(__DIR__ . '/../../'); }
/** * @test */ public function initializeUnforcedQueryStringWidthAndImage() { SLIRConfig::$forceQueryString = false; $request = new SLIRRequest(); $_SERVER['QUERY_STRING'] = 'i=/slir/Test/images/camera-logo.png&w=100'; $_GET = array(); $_GET['i'] = '/slir/Test/images/camera-logo.png'; $_GET['w'] = '100'; $request->initialize(); $this->assertSame($request->path, $_GET['i']); $this->assertSame($request->width, 100); }