Skip to content

Commit

Permalink
Cleanup substring tests (function removed already b268b1) (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu authored Feb 5, 2024
1 parent ab8419f commit c15bd5e
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions tests/Query/Mysql/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,42 +73,6 @@ public function testSoundex(): void
);
}

/**
* Test cases for MYSQL SUBSTRING function.
*/
public function testSubstring(): void
{
$this->assertDqlProducesSql(
"SELECT SUBSTRING('www.mysql.com', 1, 3) from DoctrineExtensions\Tests\Entities\Blank b",
"SELECT SUBSTR('www.mysql.com', 1, 3) AS sclr_0 FROM Blank b0_"
);

$this->assertDqlProducesSql(
"SELECT SUBSTRING('www.mysql.com', 2) from DoctrineExtensions\Tests\Entities\Blank b",
"SELECT SUBSTR('www.mysql.com', 2, LENGTH('www.mysql.com')) AS sclr_0 FROM Blank b0_"
);

$this->assertDqlProducesSql(
"SELECT SUBSTRING('www.mysql.com', -2, 2) from DoctrineExtensions\Tests\Entities\Blank b",
"SELECT SUBSTR('www.mysql.com', -2, 2) AS sclr_0 FROM Blank b0_"
);

$this->assertDqlProducesSql(
'SELECT SUBSTRING(b.id, 5, 5) from DoctrineExtensions\Tests\Entities\Blank b',
'SELECT SUBSTR(b0_.id, 5, 5) AS sclr_0 FROM Blank b0_'
);

$this->assertDqlProducesSql(
'SELECT SUBSTRING(b.id, 5) from DoctrineExtensions\Tests\Entities\Blank b',
'SELECT SUBSTR(b0_.id, 5, LENGTH(b0_.id)) AS sclr_0 FROM Blank b0_'
);

$this->assertDqlProducesSql(
'SELECT SUBSTRING(b.id, -5, 2) from DoctrineExtensions\Tests\Entities\Blank b',
'SELECT SUBSTR(b0_.id, -5, 2) AS sclr_0 FROM Blank b0_'
);
}

/**
* Test cases for MYSQL SUBSTRING_INDEX function.
*/
Expand Down

0 comments on commit c15bd5e

Please sign in to comment.