From ec45f80d80fcf94e9ffd183976009ae7d896748c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 14 Jan 2025 11:23:04 +0100 Subject: [PATCH] add test --- tests/Table/Column/LinkTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Table/Column/LinkTest.php b/tests/Table/Column/LinkTest.php index ee28a5d216..2f96003ebc 100644 --- a/tests/Table/Column/LinkTest.php +++ b/tests/Table/Column/LinkTest.php @@ -16,6 +16,8 @@ class LinkTest extends TestCase use CreateAppTrait; use TableTestTrait; + private const NBSP = "\u{00a0}"; + /** @var Table */ protected $table; @@ -26,14 +28,14 @@ protected function setUp(): void $arr = [ 'table' => [ - 1 => ['id' => 1, 'name' => 'bar', 'ref' => 'ref123', 'salary' => -123], + 1 => ['id' => 1, 'name' => 'bar', 'ref' => 'ref123', 'salary' => -1234], ], ]; $db = new Persistence\Array_($arr); $m = new Model($db, ['table' => 'table']); $m->addField('name'); $m->addField('ref'); - $m->addField('salary'); + $m->addField('salary', ['type' => 'integer']); $this->table = new Table(); $this->table->setApp($this->createApp()); $this->table->invokeInit(); @@ -72,7 +74,7 @@ public function testTdLast(): void ); self::assertSame( - 'barref123-123', + 'barref123-1' . self::NBSP . '234', $this->extractTableRow($this->table) ); } @@ -88,7 +90,7 @@ public function testTdNotLast(): void ); self::assertSame( - 'barref123-123', + 'barref123-1' . self::NBSP . '234', $this->extractTableRow($this->table) ); } @@ -105,7 +107,7 @@ public function testTwoMoneys(): void ); self::assertSame( - 'barref123-123', + 'barref123-1' . self::NBSP . '234', $this->extractTableRow($this->table) ); } @@ -278,10 +280,10 @@ public function testNoValue(): void public function testTooltip(): void { - $this->table->addDecorator('name', [Table\Column\Tooltip::class, ['tooltipField' => 'ref']]); + $this->table->addDecorator('name', [Table\Column\Tooltip::class, ['tooltipField' => 'salary']]); self::assertSame( - ' barref123', + ' barref123', $this->extractTableRow($this->table) ); }