|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Polyfill\Tests\Php84; |
| 13 | + |
| 14 | +use PHPUnit\Framework\TestCase; |
| 15 | + |
| 16 | +class PdoTest extends TestCase |
| 17 | +{ |
| 18 | + /** |
| 19 | + * @requires extension pdo_dblib |
| 20 | + */ |
| 21 | + public function testDblibConstants() |
| 22 | + { |
| 23 | + $this->assertSame(1000, \Pdo\Dblib::ATTR_CONNECTION_TIMEOUT); |
| 24 | + $this->assertSame(1001, \Pdo\Dblib::ATTR_QUERY_TIMEOUT); |
| 25 | + $this->assertSame(1002, \Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER); |
| 26 | + $this->assertSame(1003, \Pdo\Dblib::ATTR_VERSION); |
| 27 | + $this->assertSame(1004, \Pdo\Dblib::ATTR_TDS_VERSION); |
| 28 | + $this->assertSame(1005, \Pdo\Dblib::ATTR_SKIP_EMPTY_ROWSETS); |
| 29 | + $this->assertSame(1006, \Pdo\Dblib::ATTR_DATETIME_CONVERT); |
| 30 | + } |
| 31 | + |
| 32 | + /** |
| 33 | + * @requires extension pdo_firebird |
| 34 | + */ |
| 35 | + public function testFirebirdConstants() |
| 36 | + { |
| 37 | + $this->assertSame(1000, \Pdo\Firebird::ATTR_DATE_FORMAT); |
| 38 | + $this->assertSame(1001, \Pdo\Firebird::ATTR_TIME_FORMAT); |
| 39 | + $this->assertSame(1002, \Pdo\Firebird::ATTR_TIMESTAMP_FORMAT); |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * @requires extension pdo_mysql |
| 44 | + */ |
| 45 | + public function testMysqlConstants() |
| 46 | + { |
| 47 | + $this->assertSame(1000, \Pdo\Mysql::ATTR_USE_BUFFERED_QUERY); |
| 48 | + $this->assertSame(1001, \Pdo\Mysql::ATTR_LOCAL_INFILE); |
| 49 | + $this->assertSame(1002, \Pdo\Mysql::ATTR_INIT_COMMAND); |
| 50 | + $this->assertSame(1003, \Pdo\Mysql::ATTR_COMPRESS); |
| 51 | + $this->assertSame(1004, \Pdo\Mysql::ATTR_DIRECT_QUERY); |
| 52 | + $this->assertSame(1005, \Pdo\Mysql::ATTR_FOUND_ROWS); |
| 53 | + $this->assertSame(1006, \Pdo\Mysql::ATTR_IGNORE_SPACE); |
| 54 | + $this->assertSame(1007, \Pdo\Mysql::ATTR_SSL_KEY); |
| 55 | + $this->assertSame(1008, \Pdo\Mysql::ATTR_SSL_CERT); |
| 56 | + $this->assertSame(1009, \Pdo\Mysql::ATTR_SSL_CA); |
| 57 | + $this->assertSame(1010, \Pdo\Mysql::ATTR_SSL_CAPATH); |
| 58 | + $this->assertSame(1011, \Pdo\Mysql::ATTR_SSL_CIPHER); |
| 59 | + $this->assertSame(1012, \Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY); |
| 60 | + $this->assertSame(1013, \Pdo\Mysql::ATTR_MULTI_STATEMENTS); |
| 61 | + $this->assertSame(1014, \Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT); |
| 62 | + $this->assertSame(1015, \Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY); |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * @requires extension pdo_mysql |
| 67 | + * @requires extension libmysqlclient |
| 68 | + */ |
| 69 | + public function testMysqlConstantsMysqlnd() |
| 70 | + { |
| 71 | + $this->assertSame(1003, \Pdo\Mysql::ATTR_READ_DEFAULT_FILE); |
| 72 | + $this->assertSame(1004, \Pdo\Mysql::ATTR_READ_DEFAULT_GROUP); |
| 73 | + $this->assertSame(1005, \Pdo\Mysql::ATTR_MAX_BUFFER_SIZE); |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + * @requires extension pdo_odbc |
| 78 | + */ |
| 79 | + public function testOdbcConstants() |
| 80 | + { |
| 81 | + $this->assertSame(0, \Pdo\Odbc::SQL_USE_IF_NEEDED); |
| 82 | + $this->assertSame(1, \Pdo\Odbc::SQL_USE_ODBC); |
| 83 | + $this->assertSame(2, \Pdo\Odbc::SQL_USE_DRIVER); |
| 84 | + $this->assertSame(1000, \Pdo\Odbc::ATTR_USE_CURSOR_LIBRARY); |
| 85 | + $this->assertSame(1001, \Pdo\Odbc::ATTR_ASSUME_UTF8); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * @requires extension pdo_pgsql |
| 90 | + */ |
| 91 | + public function testPgsqlConstants() |
| 92 | + { |
| 93 | + $this->assertSame(1000, \Pdo\Pgsql::ATTR_DISABLE_PREPARES); |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * @requires extension pdo_sqlite |
| 98 | + */ |
| 99 | + public function testSqliteConstants() |
| 100 | + { |
| 101 | + $this->assertSame(1, \Pdo\Sqlite::OPEN_READONLY); |
| 102 | + $this->assertSame(2, \Pdo\Sqlite::OPEN_READWRITE); |
| 103 | + $this->assertSame(4, \Pdo\Sqlite::OPEN_CREATE); |
| 104 | + $this->assertSame(1000, \Pdo\Sqlite::ATTR_OPEN_FLAGS); |
| 105 | + $this->assertSame(1001, \Pdo\Sqlite::ATTR_READONLY_STATEMENT); |
| 106 | + $this->assertSame(1002, \Pdo\Sqlite::ATTR_EXTENDED_RESULT_CODES); |
| 107 | + $this->assertSame(2048, \Pdo\Sqlite::DETERMINISTIC); |
| 108 | + } |
| 109 | +} |
0 commit comments