Skip to content

Commit

Permalink
Add support for PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Nov 2, 2024
1 parent 1023db2 commit edd6983
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "^8.1"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"phpunit/phpunit": "^10.0 || ^11.0",
"phpstan/phpstan": "^1",
"squizlabs/php_codesniffer": "^3.8",
"slevomat/coding-standard": "~8.0"
Expand Down
17 changes: 12 additions & 5 deletions tests/AbstractBinaryTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,28 @@

final class AbstractBinaryTypeTest extends TestCase
{
protected AbstractBinaryType $type;

protected function setUp(): void
{
$this->type = new class () extends AbstractBinaryType {
//
};
}

public function testPrepareContent(): void
{
$content = '';
for ($i = 0; $i < 2048; $i++) {
$content .= 'x';
}

$type = $this->getMockForAbstractClass(AbstractBinaryType::class);
$this->assertEquals(1024, strlen($type->prepareContent($content)));
$this->assertEquals('78787878', substr($type->prepareContent($content), 0, 8));
$this->assertEquals(1024, strlen($this->type->prepareContent($content)));
$this->assertEquals('78787878', substr($this->type->prepareContent($content), 0, 8));
}

public function testIsBinary(): void
{
$type = $this->getMockForAbstractClass(AbstractBinaryType::class);
$this->assertTrue($type->isBinary());
$this->assertTrue($this->type->isBinary());
}
}

0 comments on commit edd6983

Please sign in to comment.