-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
test: add tests for getFieldData() type #8482
Merged
kenjis
merged 1 commit into
codeigniter4:develop
from
kenjis:test-add-getFieldData-type
Feb 10, 2024
Merged
test: add tests for getFieldData() type #8482
kenjis
merged 1 commit into
codeigniter4:develop
from
kenjis:test-add-getFieldData-type
Feb 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kenjis
force-pushed
the
test-add-getFieldData-type
branch
2 times, most recently
from
January 30, 2024 08:25
1954e71
to
3df8961
Compare
I've found there are two --- a/tests/system/Database/Live/MySQLi/GetFieldDataTest.php
+++ b/tests/system/Database/Live/MySQLi/GetFieldDataTest.php
@@ -117,7 +117,7 @@ final class GetFieldDataTest extends AbstractGetFieldDataTest
{
$this->createTableForType();
- $fields = $this->db->getFieldData($this->table);
+ $fields = $this->db->table($this->table)->get()->getFieldData();
$expected = [
0 => (object) [ But $ vendor/bin/phpunit tests/system/Database/Live/MySQLi/GetFieldDataTest.php
PHPUnit 9.6.16 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.15
Configuration: /Users/kenji/work/codeigniter/official/CodeIgniter4/phpunit.xml
.F 2 / 2 (100%)
Time: 00:00.735, Memory: 18.00 MB
There was 1 failure:
1) CodeIgniter\Database\Live\MySQLi\GetFieldDataTest::testGetFieldDataType
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
Array &0 (
0 => Array &1 (
'name' => 'id'
- 'type' => 'int'
- 'max_length' => null
- 'nullable' => false
- 'default' => null
- 'primary_key' => 1
+ 'type' => 3
+ 'type_name' => 'long'
+ 'max_length' => 0
+ 'primary_key' => 2
+ 'length' => 20
+ 'default' => ''
)
1 => Array &2 (
'name' => 'type_bigint'
- 'type' => 'bigint'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 8
+ 'type_name' => 'longlong'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 20
+ 'default' => ''
)
2 => Array &3 (
'name' => 'type_blob'
- 'type' => 'blob'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 252
+ 'type_name' => 'blob'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 65535
+ 'default' => ''
)
3 => Array &4 (
'name' => 'type_boolean'
- 'type' => 'tinyint'
- 'max_length' => 1
- 'nullable' => true
- 'default' => null
+ 'type' => 1
+ 'type_name' => 'char'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 1
+ 'default' => ''
)
4 => Array &5 (
'name' => 'type_char'
- 'type' => 'char'
- 'max_length' => 10
- 'nullable' => true
- 'default' => null
+ 'type' => 254
+ 'type_name' => 'string'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 30
+ 'default' => ''
)
5 => Array &6 (
'name' => 'type_date'
- 'type' => 'date'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 10
+ 'type_name' => 'date'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 10
+ 'default' => ''
)
6 => Array &7 (
'name' => 'type_datetime'
- 'type' => 'datetime'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 12
+ 'type_name' => 'datetime'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 19
+ 'default' => ''
)
7 => Array &8 (
'name' => 'type_decimal'
- 'type' => 'decimal'
- 'max_length' => 18
- 'nullable' => true
- 'default' => null
+ 'type' => 246
+ 'type_name' => 'newdecimal'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 20
+ 'default' => ''
)
8 => Array &9 (
'name' => 'type_double'
- 'type' => 'double'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 5
+ 'type_name' => 'double'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 22
+ 'default' => ''
)
9 => Array &10 (
'name' => 'type_enum'
- 'type' => 'enum'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 254
+ 'type_name' => 'string'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 15
+ 'default' => ''
)
10 => Array &11 (
'name' => 'type_float'
- 'type' => 'float'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 4
+ 'type_name' => 'float'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 12
+ 'default' => ''
)
11 => Array &12 (
'name' => 'type_integer'
- 'type' => 'int'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 3
+ 'type_name' => 'long'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 11
+ 'default' => ''
)
12 => Array &13 (
'name' => 'type_mediumtext'
- 'type' => 'mediumtext'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 252
+ 'type_name' => 'blob'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 50331645
+ 'default' => ''
)
13 => Array &14 (
'name' => 'type_numeric'
- 'type' => 'decimal'
- 'max_length' => 18
- 'nullable' => true
- 'default' => null
+ 'type' => 246
+ 'type_name' => 'newdecimal'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 20
+ 'default' => ''
)
14 => Array &15 (
'name' => 'type_real'
- 'type' => 'double'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 5
+ 'type_name' => 'double'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 22
+ 'default' => ''
)
15 => Array &16 (
'name' => 'type_set'
- 'type' => 'set'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 254
+ 'type_name' => 'string'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 21
+ 'default' => ''
)
16 => Array &17 (
'name' => 'type_smallint'
- 'type' => 'smallint'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 2
+ 'type_name' => 'short'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 6
+ 'default' => ''
)
17 => Array &18 (
'name' => 'type_text'
- 'type' => 'text'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 252
+ 'type_name' => 'blob'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 196605
+ 'default' => ''
)
18 => Array &19 (
'name' => 'type_time'
- 'type' => 'time'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 11
+ 'type_name' => 'time'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 10
+ 'default' => ''
)
19 => Array &20 (
'name' => 'type_timestamp'
- 'type' => 'timestamp'
- 'max_length' => null
- 'nullable' => true
- 'default' => null
+ 'type' => 7
+ 'type_name' => 'timestamp'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 19
+ 'default' => ''
)
20 => Array &21 (
'name' => 'type_varchar'
- 'type' => 'varchar'
- 'max_length' => 40
- 'nullable' => true
- 'default' => null
+ 'type' => 253
+ 'type_name' => 'var_string'
+ 'max_length' => 0
'primary_key' => 0
+ 'length' => 120
+ 'default' => ''
)
)
... |
2 tasks
kenjis
force-pushed
the
test-add-getFieldData-type
branch
from
February 1, 2024 00:08
3df8961
to
c4de4f9
Compare
Can someone approve? |
michalsn
approved these changes
Feb 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Needs #8480Description
Checklist: