Skip to content

Commit

Permalink
Merge branch '8.5' into 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 28, 2023
2 parents 1badd7d + f7e7556 commit 0da2376
Show file tree
Hide file tree
Showing 28 changed files with 257 additions and 285 deletions.
10 changes: 10 additions & 0 deletions tests/end-to-end/_files/groups/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../phpunit.xsd"
>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
36 changes: 36 additions & 0 deletions tests/end-to-end/_files/groups/tests/FooTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TestFixture\Groups;

use PHPUnit\Framework\TestCase;

final class FooTest extends TestCase
{
/**
* @group one
*/
public function testOne(): void
{
$this->assertTrue(true);
}

/**
* @group two
*/
public function testTwo(): void
{
$this->assertTrue(true);
}

public function testThree(): void
{
$this->assertTrue(true);
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
--TEST--
phpunit --exclude-group balanceIsInitiallyZero ../../_files/BankAccountTest.php
phpunit --exclude-group one,two tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--exclude-group';
$_SERVER['argv'][] = 'balanceIsInitiallyZero';
$_SERVER['argv'][] = __DIR__ . '/../../_files/BankAccountTest.php';
$_SERVER['argv'][] = 'one,two';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

.. 2 / 2 (100%)
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended


Time: %s, Memory: %s

OK (2 tests, 2 assertions)
OK (1 test, 1 assertion)
23 changes: 23 additions & 0 deletions tests/end-to-end/cli/exclude-group-configuration.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--TEST--
phpunit --exclude-group one,two
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups';
$_SERVER['argv'][] = '--exclude-group';
$_SERVER['argv'][] = 'one,two';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended


Time: %s, Memory: %s

OK (1 test, 1 assertion)
21 changes: 0 additions & 21 deletions tests/end-to-end/cli/exclude-group-isolation.phpt

This file was deleted.

21 changes: 0 additions & 21 deletions tests/end-to-end/cli/filter-class-isolation.phpt

This file was deleted.

27 changes: 27 additions & 0 deletions tests/end-to-end/cli/filter-class-match-argument.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
phpunit --filter FooTest tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'FooTest';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' ended
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended


Time: %s, Memory: %s

OK (3 tests, 3 assertions)
27 changes: 27 additions & 0 deletions tests/end-to-end/cli/filter-class-match-configuration.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
phpunit --filter FooTest
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'FooTest';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' ended
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended


Time: %s, Memory: %s

OK (3 tests, 3 assertions)
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
--TEST--
phpunit --filter doesNotExist ../../_files/BankAccountTest.php
phpunit --filter BarTest tests/FooTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'doesNotExist';
$_SERVER['argv'][] = __DIR__ . '/../../_files/BankAccountTest.php';
$_SERVER['argv'][] = 'BarTest';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
17 changes: 17 additions & 0 deletions tests/end-to-end/cli/filter-class-nomatch-configuration.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
phpunit --filter BarTest
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--debug';
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/../_files/groups';
$_SERVER['argv'][] = '--filter';
$_SERVER['argv'][] = 'BarTest';

require_once __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

No tests executed!

This file was deleted.

21 changes: 0 additions & 21 deletions tests/end-to-end/cli/filter-dataprovider-by-number-isolation.phpt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions tests/end-to-end/cli/filter-dataprovider-by-range-isolation.phpt

This file was deleted.

21 changes: 0 additions & 21 deletions tests/end-to-end/cli/filter-dataprovider-by-regexp-isolation.phpt

This file was deleted.

Loading

0 comments on commit 0da2376

Please sign in to comment.