Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup substring tests (function removed already b268b1) #430

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading