-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Tests] Optimized pdo_mysql
tests
#12751
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
[Tests] Optimized pdo_mysql
tests
#12751
Conversation
7581f9d
to
6bd8ea5
Compare
I don't have the concentration left, so I'll continue tomorrow. |
6bd8ea5
to
500b0fe
Compare
4e2f843
to
5638afc
Compare
5638afc
to
c7dd040
Compare
done |
pdo_mysql
testspdo_mysql
tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a partial review
ext/pdo_mysql/tests/bug_50323.phpt
Outdated
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | ||
$db = PDOTest::test_factory(__DIR__ . '/common.phpt'); | ||
require_once __DIR__ . '/inc/mysql_pdo_test.inc'; | ||
$db = MySQLPDOTest::factory(); | ||
|
||
@$db->exec('DROP DATABASE IF EXISTS `crazy;dbname`'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@$db->exec('DROP DATABASE IF EXISTS `crazy;dbname`'); | |
$db->exec('DROP DATABASE IF EXISTS `crazy;dbname`'); |
Why is this error suppressed in the first place :(
$tmp = $stmt->fetch(PDO::FETCH_ASSOC); | ||
$con1 = $tmp['_con1']; | ||
|
||
@$db2 = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); | ||
@$db2 = new PDO($dsn, $user, $pass, [PDO::ATTR_PERSISTENT => true]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@$db2 = new PDO($dsn, $user, $pass, [PDO::ATTR_PERSISTENT => true]); | |
$db2 = new PDO($dsn, $user, $pass, [PDO::ATTR_PERSISTENT => true]); |
Thank you, Fixed everything except for error suppression. There was an oversight, so I fixed that as well. When it comes to error suppression, I first need to understand what it want to do with the test, and I look at it one by one. This will take some time, so please be patient. |
d9ec0d1
to
db5b7da
Compare
Removed error suppression that could be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question but LGTM otherwise
$db = PDOTest::test_factory(__DIR__ . '/common.phpt'); | ||
require_once __DIR__ . '/inc/mysql_pdo_test.inc'; | ||
$db = MySQLPDOTest::factory(); | ||
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this attribute being set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This attribute was set in PDOTest::test_factory, so the test will fail if it is not set.
Alternatively, there is a way to modify the expected value of the test.
Thanks! |
take2 of #12555
Summary of changes
$db
is prepared usingmysql_pdo_test.inc
(excluding common.phpt)Tests that have not been confirmed to work
I have confirmed that all tests except the ones listed below pass.
Tests that are probably always skipped:
only nightly (these run only with libmysql)