public function testGetMultipleBuildConfiguration() { $config = new ApplicationConfiguration(__DIR__ . '/__files/MyApp'); $this->assertNull($config->getDefaultBuild()); $config->addBuild('desktop', ['build_path' => 'build/development/desktop/MyApp', 'microloader' => '/bootstrap.js', 'manifest' => '/desktop.json', 'app_cache' => null], ['build_path' => 'build/production/desktop/MyApp', 'microloader' => 'microloader.js', 'manifest' => 'app.json', 'app_cache' => 'cache.appcache'])->addBuild('tablet', ['build_path' => 'build/development/tablet/MyApp', 'microloader' => '/bootstrap.js', 'manifest' => '/tablet.json', 'app_cache' => null], ['build_path' => 'build/production/tablet/MyApp', 'microloader' => 'microloader.js', 'manifest' => 'app.json', 'app_cache' => 'cache.appcache']); $this->assertEquals('desktop', $config->getDefaultBuild()); $this->assertEquals(__DIR__ . '/__files/MyApp/desktop.json', $config->getManifestPath('desktop', true)); $this->assertEquals(__DIR__ . '/__files/MyApp/bootstrap.js', $config->getMicroLoaderPath('desktop', true)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/desktop/MyApp/app.json', $config->getManifestPath('desktop', false)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/desktop/MyApp/microloader.js', $config->getMicroLoaderPath('desktop', false)); $this->assertEquals(__DIR__ . '/__files/MyApp/tablet.json', $config->getManifestPath('tablet', true)); $this->assertEquals(__DIR__ . '/__files/MyApp/bootstrap.js', $config->getMicroLoaderPath('tablet', true)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/tablet/MyApp/app.json', $config->getManifestPath('tablet', false)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/tablet/MyApp/microloader.js', $config->getMicroLoaderPath('tablet', false)); $this->assertEquals(__DIR__ . '/__files/MyApp/desktop.json', $config->getManifestPath(null, true)); $this->assertEquals(__DIR__ . '/__files/MyApp/bootstrap.js', $config->getMicroLoaderPath(null, true)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/desktop/MyApp/app.json', $config->getManifestPath(null, false)); $this->assertEquals(__DIR__ . '/__files/MyApp/build/production/desktop/MyApp/microloader.js', $config->getMicroLoaderPath(null, false)); }
/** * @return string|null */ public function getDefaultBuild() { return $this->configuration->getDefaultBuild(); }