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
This commit is contained in:
Joe Nahmias 2023-02-19 19:52:57 -05:00 committed by Frédéric Guillot
parent a69709b305
commit 87e9a770c8
1 changed files with 0 additions and 1 deletions

View File

@ -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 '));
}
}