From 87e9a770c8c88a84182eb20c9465b6a1319a0f20 Mon Sep 17 00:00:00 2001 From: Joe Nahmias Date: Sun, 19 Feb 2023 19:52:57 -0500 Subject: [PATCH] fix(test): searching with trailing space returns data on MSSQL Microsoft SQL Server automatically pads the shorter of two strings of unequal length with spaces prior to comparisons. Thus, searching for username = 'test ' (unexpectedly) matches a row where username = 'test'. Since kanboard does not rely on this behavior or its absence, simply remove the test as unecessary to avoid this differing result amongst the various database backends. Ref: https://support.microsoft.com/en-us/topic/inf-how-sql-server-compares-strings-with-trailing-spaces-b62b1a2d-27d3-4260-216d-a605719003b0 --- tests/units/Model/UserModelTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/units/Model/UserModelTest.php b/tests/units/Model/UserModelTest.php index d705f0120..4cb550c0b 100644 --- a/tests/units/Model/UserModelTest.php +++ b/tests/units/Model/UserModelTest.php @@ -401,6 +401,5 @@ class UserModelTest extends Base $this->assertNotFalse($userModel->create(array('username' => 'test '))); $this->assertNotEmpty($userModel->getByUsername('test')); - $this->assertEmpty($userModel->getByUsername('test ')); } }