/** * Test map view */ public function testMapView() { \Geoprojection::create(['epsg' => 4326, 'projection' => "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"]); $crawler = $this->client->request('GET', '/dresden/rivers'); $this->assertResponseOk(); $this->assertCount(1, $crawler->filter('iframe')); $this->assertCount(1, $crawler->filter('div.map-container')); }
/** * Seed the prefixes table based on the prefixes json file * * @return void */ private function seedGeoprojections() { // Empty the ontology table \Geoprojection::truncate(); // Fetch the ontology from the json file $geoprojections = json_decode(file_get_contents(app_path() . '/database/seeds/data/geoprojections.json')); if (!empty($geoprojections)) { \Geoprojection::truncate(); foreach ($geoprojections as $language) { \Geoprojection::create(array('epsg' => $language->epsg, 'projection' => $language->projection)); } $this->command->info("Added the geographical projections."); } }
/** * Delete everything out of our testing database. */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); \Definition::truncate(); \CsvDefinition::truncate(); \InstalledDefinition::truncate(); \JsonDefinition::truncate(); \ShpDefinition::truncate(); \SparqlDefinition::truncate(); \XlsDefinition::truncate(); \XmlDefinition::truncate(); \GeoProperty::truncate(); \TabularColumns::truncate(); \Geoprojection::truncate(); }
public function testPutApi() { \Geoprojection::create(['epsg' => 4326, 'projection' => "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"]); // Publish each shp file in the test shp data folder. foreach ($this->test_data as $entry) { $name = $entry['name']; $file = $entry['file']; // Set the definition parameters. $data = array('description' => "A shp publication from the {$file} shp file.", 'epsg' => '4326', 'uri' => app_path() . "/storage/data/tests/shp/{$file}.shp", 'type' => 'shp'); // Set the headers. $headers = array('Content-Type' => 'application/tdt.definition+json'); $this->updateRequest('PUT', $headers, $data); // Put the definition controller to the test! $controller = \App::make('Tdt\\Core\\Definitions\\DefinitionController'); $response = $controller->handle("shp/{$name}"); // Check if the creation of the definition succeeded. $this->assertEquals(200, $response->getStatusCode()); } }
private function seedGeoProjections() { $this->command->info('---- Geo projections ----'); $this->command->info('Fetching geoprojections from the local json file.'); $geoprojections = json_decode(file_get_contents(app_path() . '/database/seeds/data/geoprojections.json')); if (!empty($geoprojections)) { $this->command->info('Geoprojections have been found, deleting the current ones, and replacing them with the new ones.'); \Geoprojection::truncate(); foreach ($geoprojections as $language) { \Geoprojection::create(array('epsg' => $language->epsg, 'projection' => $language->projection)); } $this->command->info('Added the geoprojections from a local json file.'); } else { $this->command->info('No languages have not been found, the old ones will not be replaced.'); } }
public function getAll() { return \Geoprojection::all(array('epsg', 'projection'))->toArray(); }