From a07ad0fe73e5501b6be8e131713ff0dcaba871a2 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Sun, 26 Nov 2023 20:29:38 +0100 Subject: [PATCH] FichinterTest: add errorsToString() Adding $localobject->errorsToString() as third argument to the assert will allow to forward internal errors towards the tests and display them accordingly. --- test/phpunit/FichinterTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index 755642cc39a..689b797bb74 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -144,7 +144,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $result=$localobject->create($user); print __METHOD__." result=".$result."\n"; - $this->assertLessThan($result, 0); + $this->assertLessThan($result, 0, $localobject->errorsToString()); return $result; } @@ -170,7 +170,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; - $this->assertLessThan($result, 0); + $this->assertLessThan($result, 0, $localobject->errorsToString()); return $localobject; } @@ -195,7 +195,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $result=$localobject->setValid($user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertLessThan($result, 0); + $this->assertLessThan($result, 0, $localobject->errorsToString()); return $localobject; } @@ -223,7 +223,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $localobject->info($localobject->id); print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; - $this->assertNotEquals($localobject->date_creation, ''); + $this->assertNotEquals($localobject->date_creation, '', $localobject->errorsToString()); return $localobject->id; } @@ -250,7 +250,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $result=$localobject->delete($user); print __METHOD__." id=".$id." result=".$result."\n"; - $this->assertLessThan($result, 0); + $this->assertLessThan($result, 0, $localobject->errorsToString()); return $result; } }