summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/tests/bootstrap.php
blob: 1b0e39e507a15bee2534c42e69460220a1853dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

if ( PHP_SAPI !== 'cli' ) {
	die( 'Not an entry point' );
}

if ( defined( 'MEDIAWIKI' ) ) {
	// If testing against an older version of MediaWiki, define
	// an empty trait to avoid fatal errors.
	if ( !trait_exists( PHPUnit4And6Compat::class ) ) {
		trait PHPUnit4And6Compat {
			public function expectException( string $exception ) {
				$this->setExpectedException( $exception );
			}
		}
	}

	return;
}

if ( !trait_exists( PHPUnit4And6Compat::class ) ) {
	trait PHPUnit4And6Compat {
	}
}

error_reporting( -1 );
ini_set( 'display_errors', 1 );

if ( !is_readable( __DIR__ . '/../vendor/autoload.php' ) ) {
	die( 'You need to install this package with Composer before you can run the tests' );
}

require __DIR__ . '/../vendor/autoload.php';