Skip to content

Commit d491808

Browse files
Stephan Wentzpl-github
authored andcommitted
fix: Update dependencies
1 parent 2cf7f09 commit d491808

14 files changed

Lines changed: 229 additions & 220 deletions

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
php-version:
1919
- "8.0"
2020
- "8.1"
21+
- "8.2"
2122
operating-system: ["ubuntu-latest"]
2223

2324
steps:

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
vendor
2-
composer.lock
3-
.idea/
4-
.phpunit.result.cache
1+
/.idea/
2+
/.phpunit.cache
3+
/composer.lock
4+
/phpcs.xml
5+
/phpstan.neon
6+
/phpunit.xml
7+
/vendor

composer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
},
1616
"require-dev": {
1717
"mikey179/vfsstream": "^1.6.10",
18-
"phpunit/phpunit": "^9.5",
18+
"phpunit/phpunit": "^10.1",
1919
"symfony/http-foundation": "^5.4|^6.0",
2020
"symfony/security-core": "^5.4|^6.0",
21-
"phpspec/prophecy-phpunit": "^2.0.1",
22-
"squizlabs/php_codesniffer": "^3.6",
23-
"brainbits/phpcs-standard": "^6.0",
21+
"brainbits/phpcs-standard": "^7.0",
2422
"phpstan/phpstan": "^1.0",
2523
"brainbits/phpstan-rules": "^3.0"
2624
},
File renamed without changes.
File renamed without changes.

phpunit.xml.dist

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
<phpunit backupGlobals="false"
2-
backupStaticAttributes="false"
3-
colors="true"
4-
convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true">
7-
<testsuite name="blocking">
8-
<directory suffix=".php">tests</directory>
9-
</testsuite>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuite name="blocking">
4+
<directory suffix=".php">tests</directory>
5+
</testsuite>
106
</phpunit>

phpunit.xml.dist.bak

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<phpunit backupGlobals="false"
2+
backupStaticAttributes="false"
3+
colors="true"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true">
7+
<testsuite name="blocking">
8+
<directory suffix=".php">tests</directory>
9+
</testsuite>
10+
</phpunit>

tests/BlockTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,86 +15,86 @@
1515
use Brainbits\Blocking\Identity\IdentityInterface;
1616
use Brainbits\Blocking\Owner\OwnerInterface;
1717
use DateTimeImmutable;
18+
use PHPUnit\Framework\MockObject\MockObject;
1819
use PHPUnit\Framework\TestCase;
19-
use Prophecy\PhpUnit\ProphecyTrait;
20-
use Prophecy\Prophecy\ObjectProphecy;
2120

22-
/**
23-
* Block test
24-
*/
2521
class BlockTest extends TestCase
2622
{
27-
use ProphecyTrait;
28-
2923
/**
30-
* @var IdentityInterface|ObjectProphecy
24+
* @var IdentityInterface|MockObject
3125
*/
3226
private $identifier;
3327

3428
/**
35-
* @var OwnerInterface|ObjectProphecy
29+
* @var OwnerInterface|MockObject
3630
*/
3731
private $owner;
3832

3933
protected function setUp(): void
4034
{
41-
$this->identifier = $this->prophesize(IdentityInterface::class)->reveal();
35+
$this->identifier = $this->createMock(IdentityInterface::class);
4236

43-
$this->owner = $this->prophesize(OwnerInterface::class);
44-
$this->owner->__toString()
37+
$this->owner = $this->createMock(OwnerInterface::class);
38+
$this->owner->expects($this->any())
39+
->method('__toString')
4540
->willReturn('dummyOwner');
4641
}
4742

4843
public function testConstruct(): void
4944
{
50-
$block = new Block($this->identifier, $this->owner->reveal(), new DateTimeImmutable());
45+
$block = new Block($this->identifier, $this->owner, new DateTimeImmutable());
5146

5247
$this->assertInstanceOf(Block::class, $block);
5348
}
5449

5550
public function testGetIdentifierReturnsCorrectValue(): void
5651
{
57-
$block = new Block($this->identifier, $this->owner->reveal(), new DateTimeImmutable());
52+
$block = new Block($this->identifier, $this->owner, new DateTimeImmutable());
5853

5954
$this->assertSame($this->identifier, $block->getIdentity());
6055
}
6156

6257
public function testGetOwnerReturnsCorrectValue(): void
6358
{
64-
$block = new Block($this->identifier, $this->owner->reveal(), new DateTimeImmutable());
59+
$block = new Block($this->identifier, $this->owner, new DateTimeImmutable());
6560

66-
$this->assertSame($this->owner->reveal(), $block->getOwner());
61+
$this->assertSame($this->owner, $block->getOwner());
6762
}
6863

6964
public function testIsOwnedByReturnsTrue(): void
7065
{
71-
$block = new Block($this->identifier, $this->owner->reveal(), new DateTimeImmutable());
66+
$block = new Block($this->identifier, $this->owner, new DateTimeImmutable());
7267

73-
$this->owner->equals($this->owner->reveal())
68+
$this->owner->expects($this->once())
69+
->method('equals')
70+
->with($this->owner)
7471
->willReturn(true);
7572

76-
$this->assertTrue($block->isOwnedBy($this->owner->reveal()));
73+
$this->assertTrue($block->isOwnedBy($this->owner));
7774
}
7875

7976
public function testIsOwnedByReturnsFalse(): void
8077
{
81-
$block = new Block($this->identifier, $this->owner->reveal(), new DateTimeImmutable());
78+
$block = new Block($this->identifier, $this->owner, new DateTimeImmutable());
8279

83-
$owner = $this->prophesize(OwnerInterface::class);
84-
$owner->__toString()
80+
$owner = $this->createMock(OwnerInterface::class);
81+
$this->owner->expects($this->any())
82+
->method('__toString')
8583
->willReturn('dummyOwner');
8684

87-
$this->owner->equals($owner->reveal())
88-
->willReturn(false);
85+
$this->owner->expects($this->once())
86+
->method('equals')
87+
->with($owner)
88+
->willReturn(false);
8989

90-
$this->assertFalse($block->isOwnedBy($owner->reveal()));
90+
$this->assertFalse($block->isOwnedBy($owner));
9191
}
9292

9393
public function testGetCreatedAtReturnsCorrectValue(): void
9494
{
9595
$createdAt = new DateTimeImmutable();
9696

97-
$block = new Block($this->identifier, $this->owner->reveal(), $createdAt);
97+
$block = new Block($this->identifier, $this->owner, $createdAt);
9898
$result = $block->getCreatedAt();
9999

100100
$this->assertInstanceOf(DateTimeImmutable::class, $result);
@@ -105,7 +105,7 @@ public function testGetUpdatedAtReturnsCreatedAtValueAfterInstanciation(): void
105105
{
106106
$createdAt = new DateTimeImmutable();
107107

108-
$block = new Block($this->identifier, $this->owner->reveal(), $createdAt);
108+
$block = new Block($this->identifier, $this->owner, $createdAt);
109109
$result = $block->getUpdatedAt();
110110

111111
$this->assertInstanceOf(DateTimeImmutable::class, $result);
@@ -116,7 +116,7 @@ public function testTouchUpdatesValue(): void
116116
{
117117
$createdAt = new DateTimeImmutable();
118118

119-
$block = new Block($this->identifier, $this->owner->reveal(), $createdAt);
119+
$block = new Block($this->identifier, $this->owner, $createdAt);
120120

121121
$updatedAt = new DateTimeImmutable();
122122

0 commit comments

Comments
 (0)