summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/tests/Unit/MediaWiki/GeoJsonContentTest.php
blob: df2cc7598a3b04885ac0068a307fc41ace45c886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

declare( strict_types = 1 );

namespace Maps\Tests\Unit\MediaWiki;

use Maps\MediaWiki\Content\GeoJsonContent;
use PHPUnit\Framework\TestCase;

class GeoJsonContentTest extends TestCase {

	public function testEmptyJsonIsNotValidContent() {
		$this->assertFalse( ( new GeoJsonContent( '{}' ) )->isValid() );
	}

	public function testMinimalGeoJsonIsValid() {
		$this->assertTrue( ( new GeoJsonContent(
			'{"type": "FeatureCollection", "features": []}'
		) )->isValid() );
	}

}