Skip to content

Commit

Permalink
Refactor code to avoid deprecated phpunit calls
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed May 4, 2024
1 parent 6d52d48 commit 6fb8878
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/AbstractTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ final class AbstractTypeTest extends TestCase
{
public function testToString(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertEquals('', $type);
$this->assertEquals('', (string) $this->getTestAbstractType());
}

public function testMatches(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->matches('test'));
$this->assertFalse($this->getTestAbstractType()->matches('test'));
}

public function testIsImage(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->isImage());
$this->assertFalse($this->getTestAbstractType()->isImage());
}

public function testPrepareContent(): void
Expand All @@ -34,13 +31,18 @@ public function testPrepareContent(): void
$content .= 'x';
}

$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertEquals(1024, strlen($type->prepareContent($content)));
$this->assertEquals(1024, strlen($this->getTestAbstractType()->prepareContent($content)));
}

public function testIsBinary(): void
{
$type = $this->getMockForAbstractClass(AbstractType::class);
$this->assertFalse($type->isBinary());
$this->assertFalse($this->getTestAbstractType()->isBinary());
}

private function getTestAbstractType(): AbstractType
{
return new class () extends AbstractType
{
};
}
}

0 comments on commit 6fb8878

Please sign in to comment.