Skip to content

Commit 3c76234

Browse files
authored
Merge pull request #28 from bigcommerce/laravel-11-support
upgrade to phpunit 11.1
2 parents ecf48b3 + 2c9a64d commit 3c76234

4 files changed

Lines changed: 6 additions & 26 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs_default: &jobs_default
99
php-version: << matrix.php-version >>
1010
matrix:
1111
parameters:
12-
php-version: [ "8.1", "8.2", "8.3" ]
12+
php-version: [ "8.2", "8.3" ]
1313

1414

1515
workflows:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"minimum-stability": "dev",
2323
"prefer-stable": true,
2424
"require": {
25-
"php": "^8.1",
25+
"php": "^8.2",
2626
"bigcommerce/injector": "^4.1",
2727
"phpspec/prophecy-phpunit": "^2.0",
28-
"phpunit/phpunit": "^9.5 || ^10.0"
28+
"phpunit/phpunit": "^11.0"
2929
},
3030
"require-dev": {
3131
"phpstan/phpstan": "^1.10"

tests/Dummy/DummyTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
use Bigcommerce\MockInjector\AutoMockingTest;
88
use Exception;
99
use Prophecy\Prophecy\ObjectProphecy;
10+
use PHPUnit\Framework\Attributes\Group;
1011

11-
/**
12-
* @group dummy
13-
*/
12+
#[Group('dummy')]
1413
class DummyTest extends AutoMockingTest
1514
{
1615
/**

tests/MockInjectorTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
use Tests\Dummy\DummyDependency;
1111
use Tests\Dummy\DummySubDependency;
1212

13-
/**
14-
* @coversDefaultClass \Bigcommerce\MockInjector\MockInjector
15-
*/
1613
class MockInjectorTest extends AutoMockingTest
1714
{
1815
/** @var ObjectProphecy|ProphecyMockingContainer */
@@ -27,19 +24,13 @@ protected function setUp(): void
2724
$this->mockInjector = $this->prophesize(InjectorInterface::class);
2825
}
2926

30-
/**
31-
* @covers ::create
32-
*/
27+
3328
public function testCreate() : void
3429
{
3530
$this->mockInjector->create("abc123", [1 => "hello"])->willReturn("cat")->shouldBeCalledTimes(1);
3631
$i = new MockInjector($this->mockContainer->reveal(), $this->mockInjector->reveal());
3732
$this->assertEquals("cat", $i->create("abc123", [1 => "hello"]));
3833
}
39-
40-
/**
41-
* @covers ::invoke
42-
*/
4334
public function testInvoke() : void
4435
{
4536
$obj = new \stdClass();
@@ -48,29 +39,20 @@ public function testInvoke() : void
4839
$this->assertEquals("fish", $i->invoke($obj, "method1", [1 => "hello"]));
4940
}
5041

51-
/**
52-
* @covers ::checkPredictions
53-
*/
5442
public function testCheckPredictions() : void
5543
{
5644
$this->mockContainer->checkPredictions()->shouldBeCalledTimes(1);
5745
$i = new MockInjector($this->mockContainer->reveal(), $this->mockInjector->reveal());
5846
$i->checkPredictions();
5947
}
6048

61-
/**
62-
* @covers ::getAllMocks
63-
*/
6449
public function testGetAllMocks() : void
6550
{
6651
$this->mockContainer->getAllMocks()->willReturn([1, 2, 6])->shouldBeCalledTimes(1);
6752
$i = new MockInjector($this->mockContainer->reveal(), $this->mockInjector->reveal());
6853
$this->assertEquals([1, 2, 6], $i->getAllMocks());
6954
}
7055

71-
/**
72-
* @covers ::getMock
73-
*/
7456
public function testGetMock() : void
7557
{
7658
$dummy = new \stdClass();
@@ -82,7 +64,6 @@ public function testGetMock() : void
8264
/**
8365
* This is a live integration test. We wont provide any dependencies (so use poor mans DI)
8466
* and will instantiate an object with an auto-mocked dependency.
85-
* @covers ::__construct
8667
*/
8768
public function testWithoutDependencies() : void
8869
{

0 commit comments

Comments
 (0)