From f19a74caade49e00842fd5e3261c81e0a9b5d8c4 Mon Sep 17 00:00:00 2001 From: Skorobogatko Alexei Date: Fri, 28 Oct 2022 10:08:09 +0300 Subject: [PATCH] no Stringable in php7.4 --- src/Image.php | 6 +++--- tests/Widgets/TextTest.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Image.php b/src/Image.php index d500eb6..209d5aa 100644 --- a/src/Image.php +++ b/src/Image.php @@ -2,12 +2,12 @@ namespace Tkui; -use Stringable; - /** * Contract for graphic images. + * + * TODO: extends Stringable */ -interface Image extends Stringable +interface Image { public function width(): int; diff --git a/tests/Widgets/TextTest.php b/tests/Widgets/TextTest.php index 40ac936..4cdb654 100644 --- a/tests/Widgets/TextTest.php +++ b/tests/Widgets/TextTest.php @@ -8,6 +8,7 @@ use Tkui\Widgets\Text\Text; use Tkui\Widgets\Text\TextIndex; use PHPUnit\Framework\MockObject\MockObject; +use Tkui\TclTk\TkImage; class TextTest extends TestCase { @@ -174,7 +175,9 @@ public function insert_embedded_image_into_specified_position() ]); /** @var Image|MockObject */ - $image = $this->createMock(Image::class); + // FIXME: Since Image doesn't have Stringable TkImage is used here, after switching + // to PHP8 it must be changed to Image interface instead of TkImage. + $image = $this->createMock(TkImage::class); $image->expects($this->once()) ->method('__toString') ->willReturn('i0')