Skip to content

Commit 5984c2c

Browse files
Merge branch '10.5' into 11.5
2 parents 61f0b18 + 649ea9d commit 5984c2c

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

ChangeLog-11.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [11.5.27] - 2025-MM-DD
6+
7+
### Fixed
8+
9+
* [#6254](https://github.com/sebastianbergmann/phpunit/issues/6254): `defects,random`configuration is supported by implementation, but it is not allowed by the XML configuration file schema
10+
511
## [11.5.26] - 2025-07-04
612

713
### Fixed
@@ -243,6 +249,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
243249
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
244250
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)
245251

252+
[11.5.27]: https://github.com/sebastianbergmann/phpunit/compare/11.5.26...11.5
246253
[11.5.26]: https://github.com/sebastianbergmann/phpunit/compare/11.5.25...11.5.26
247254
[11.5.25]: https://github.com/sebastianbergmann/phpunit/compare/11.5.24...11.5.25
248255
[11.5.24]: https://github.com/sebastianbergmann/phpunit/compare/11.5.23...11.5.24

phpunit.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
<xs:restriction base="xs:string">
119119
<xs:enumeration value="default"/>
120120
<xs:enumeration value="defects"/>
121+
<xs:enumeration value="defects,random"/>
121122
<xs:enumeration value="depends"/>
122123
<xs:enumeration value="depends,defects"/>
123124
<xs:enumeration value="depends,duration"/>

schema/10.5.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
<xs:restriction base="xs:string">
117117
<xs:enumeration value="default"/>
118118
<xs:enumeration value="defects"/>
119+
<xs:enumeration value="defects,random"/>
119120
<xs:enumeration value="depends"/>
120121
<xs:enumeration value="depends,defects"/>
121122
<xs:enumeration value="depends,duration"/>

tests/unit/Runner/TestSuiteSorterTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,42 @@ public function testCanSetRandomizationWithASeed(): void
503503
$this->assertSame($expectedOrder, $sorter->getExecutionOrder());
504504
}
505505

506+
public function testCanSetRandomizationWithDefectsFirst(): void
507+
{
508+
$cache = new DefaultResultCache;
509+
510+
$runState = [
511+
'testOne' => ['state' => TestStatus::success(), 'time' => 1],
512+
'testTwo' => ['state' => TestStatus::success(), 'time' => 1],
513+
'testThree' => ['state' => TestStatus::error(), 'time' => 1],
514+
'testFour' => ['state' => TestStatus::success(), 'time' => 1],
515+
'testFive' => ['state' => TestStatus::error(), 'time' => 1],
516+
];
517+
518+
foreach ($runState as $testName => $data) {
519+
$cache->setStatus(MultiDependencyTest::class . '::' . $testName, $data['state']);
520+
$cache->setTime(MultiDependencyTest::class . '::' . $testName, $data['time']);
521+
}
522+
523+
$sorter = new TestSuiteSorter($cache);
524+
525+
$suite = TestSuite::empty('test suite name');
526+
$suite->addTestSuite(new ReflectionClass(MultiDependencyTest::class));
527+
528+
mt_srand(54321);
529+
$sorter->reorderTestsInSuite($suite, TestSuiteSorter::ORDER_RANDOMIZED, false, TestSuiteSorter::ORDER_DEFECTS_FIRST);
530+
531+
$expectedOrder = [
532+
MultiDependencyTest::class . '::testFive',
533+
MultiDependencyTest::class . '::testThree',
534+
MultiDependencyTest::class . '::testTwo',
535+
MultiDependencyTest::class . '::testFour',
536+
MultiDependencyTest::class . '::testOne',
537+
];
538+
539+
$this->assertSame($expectedOrder, $sorter->getExecutionOrder());
540+
}
541+
506542
public function testCanSetRandomizationWithASeedAndResolveDependencies(): void
507543
{
508544
$suite = TestSuite::empty('test suite name');

0 commit comments

Comments
 (0)