|
| 1 | +<?php |
| 2 | +/* |
| 3 | + * GeoServer PHP Client |
| 4 | + * |
| 5 | + * Copyright (c) 2018 Oneoff-tech UG, Germany, www.oneofftech.xyz |
| 6 | + * |
| 7 | + * This program is Free Software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU Affero General Public License as |
| 9 | + * published by the Free Software Foundation, either version 3 of the |
| 10 | + * License, or (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Affero General Public |
| 18 | + * License along with this program. If not, see |
| 19 | + * <http://www.gnu.org/licenses/>. |
| 20 | + */ |
| 21 | + |
| 22 | +namespace Tests\Unit; |
| 23 | + |
| 24 | +use Tests\TestCase; |
| 25 | +use OneOffTech\GeoServer\GeoFile; |
| 26 | +use OneOffTech\GeoServer\GeoType; |
| 27 | +use OneOffTech\GeoServer\GeoFormat; |
| 28 | +use OneOffTech\GeoServer\StyleFile; |
| 29 | + |
| 30 | +class StyleFileTest extends TestCase |
| 31 | +{ |
| 32 | + public function test_style_is_supported() |
| 33 | + { |
| 34 | + $supported = StyleFile::isSupported(__DIR__ . '/../fixtures/style.sld'); |
| 35 | + $this->assertTrue($supported); |
| 36 | + } |
| 37 | + |
| 38 | + public function test_style_file_load() |
| 39 | + { |
| 40 | + $styleName = 'style_test'; |
| 41 | + $file = StyleFile::from(__DIR__ . '/../fixtures/style.sld')->name($styleName); |
| 42 | + |
| 43 | + $this->assertInstanceOf(StyleFile::class, $file); |
| 44 | + $this->assertEquals('application/vnd.ogc.sld+xml', $file->mimeType); |
| 45 | + $this->assertEquals('sld', $file->extension); |
| 46 | + $this->assertEquals('style_test', $file->name); |
| 47 | + $this->assertEquals('style.sld', $file->originalName); |
| 48 | + } |
| 49 | +} |
0 commit comments