File: requires-environment-variable.phpt

package info (click to toggle)
phpunit 13.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,072 kB
  • sloc: php: 106,613; xml: 2,216; makefile: 116; sh: 88
file content (36 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (2)
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
34
35
36
--TEST--
Tests are correctly ran based on environment variables requirements
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../_files/requires_environment_variable/phpunit.xml';
$_SERVER['argv'][] = '--display-skipped';

require __DIR__ . '/../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s
Configuration: %s

SSS....                                                             7 / 7 (100%)

Time: %s, Memory: %s

There were 3 skipped tests:

1) PHPUnit\TestFixture\requires_environment_variable\SomeTest::testShouldNotRunFOOHasWrongValue
Environment variable "FOO" is required to be "bar".

2) PHPUnit\TestFixture\requires_environment_variable\SomeTest::testShouldNotRunBARIsEmpty
Environment variable "BAR" is required.

3) PHPUnit\TestFixture\requires_environment_variable\SomeTest::testShouldNotRunBAZDoesNotExist
Environment variable "BAZ" is required.

OK, but some tests were skipped!
Tests: 7, Assertions: 4, Skipped: 3.