Skip to content

Commit 104fca2

Browse files
authored
Merge pull request #12 from CakeDC/3.next-cake5-upgrade
3.next cake5 upgrade
2 parents 1cf01a2 + 6dde7f0 commit 104fca2

34 files changed

Lines changed: 834 additions & 664 deletions

.editorconfig

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
; This file is for unifying the coding style for different editors and IDEs.
22
; More information at http://editorconfig.org
33

4-
root = false
4+
root = true
55

66
[*]
77
indent_style = space
88
indent_size = 4
9-
charset = "utf-8"
109
end_of_line = lf
1110
insert_final_newline = true
1211
trim_trailing_whitespace = true
1312

13+
[*.bat]
14+
end_of_line = crlf
15+
1416
[*.yml]
15-
indent_style = space
1617
indent_size = 2
18+
19+
[*.xml]
20+
indent_size = 2
21+
22+
[Makefile]
23+
indent_style = tab
24+
25+
[*.neon]
26+
indent_style = tab

.gitignore

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1-
.idea
1+
*.diff
2+
*.err
3+
*.log
4+
*.orig
5+
*.rej
6+
*.swo
7+
*.swp
8+
*.vi
9+
*~
10+
.idea/*
11+
nbproject/*
12+
.vscode
13+
.DS_Store
14+
.cache
15+
.phpunit.cache
16+
.project
17+
.settings
18+
.svn
19+
errors.err
20+
tags
21+
node_modules
22+
package-lock.json
23+
/.phpunit.result.cache
24+
/nbproject/
25+
/composer.lock
26+
/tools
227
/vendor
3-
composer.lock
28+
/phpunit.xml
29+
/webroot/css/style.css.map
30+
/webroot/mix.js.map
31+
/webroot/mix-manifest.json

.phive/phars.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpstan" version="1.10.14" installed="1.10.14" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.10.0" installed="5.10.0" location="./tools/psalm" copy="false"/>
5+
</phive>

.semver

Lines changed: 0 additions & 5 deletions
This file was deleted.

Docs/Documentation/Examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Importing template database form sql file, by default it will load `config/sql/t
1010
bin/cake db_test -i
1111
```
1212

13-
Use `--import-database-file` to specify the sql file to be loaded
13+
Use `-f` to specify the sql file to be loaded
1414

1515
```
16-
bin/cake db_test -i --import-database-file=files/dump.sql
16+
bin/cake db_test -i -f=files/dump.sql
1717
```
1818

1919

Docs/Documentation/Installation.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ Load the plugin
1414
```
1515
bin/cake plugin load CakeDC/DbTest
1616
```
17-
Note you'll need this plugin loaded in the `cli` section of your `Application::bootstrap`, around the line loading Bake Plugin: `$this->addPlugin('Bake');`
17+
Note you'll need this plugin loaded in the `cli` section of your `Application::bootstrap`, around the line loading
18+
Bake Plugin: `$this->addPlugin('DbTestPlugin');`
1819

1920
Configuration
2021
-------------
2122

22-
Plugin requires an additional database connection to create the database snapshot named **test_template**.
23+
Plugin requires an additional database connection to create the database snapshot named **test_template**.
2324
This connection is used as an unchangeable source of test fixtures.
2425

2526
Add the next configuration setting into app.php
@@ -29,8 +30,8 @@ Add the next configuration setting into app.php
2930
'Datasources' => [
3031
// ...
3132
'test_template' => [
32-
'className' => 'Cake\Database\Connection',
33-
'driver' => 'Cake\Database\Driver\Mysql',
33+
'className' => \Cake\Database\Connection::class,
34+
'driver' => \Cake\Database\Driver\Mysql::class,
3435
'persistent' => false,
3536
'host' => 'localhost',
3637
'username' => 'my_app',
@@ -44,11 +45,14 @@ Add the next configuration setting into app.php
4445

4546
PHPUnit
4647
-------
47-
Copy https://github.com/CakeDC/cakephp-db-test/blob/master/phpunit.xml.dbtest as phpunit.xml.dist in your project (modify if needed)
48+
Copy https://github.com/CakeDC/cakephp-db-test/blob/master/phpunit.xml.dbtest as phpunit.xml.dist in your
49+
project (modify if needed)
4850

4951
Fixture database
5052
----------------
5153

52-
Note from now on, you will NOT use fixture files, but rely on a "fixture database" allowing you to run migrations to it, modify your fixture data with your sql editor, or import fixtures from the live database using a regular table or database import tool, for example `mysqldump`.
54+
Note from now on, you will NOT use fixture files, but rely on a "fixture database" allowing you to run
55+
migrations to it, modify your fixture data with your sql editor, or import fixtures from the live
56+
database using a regular table or database import tool, for example `mysqldump`.
5357

5458

Docs/Documentation/Overview.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Generic cycle of test execution under DbTest
1515
* Before test method starts, DbTest initializes the transaction.
1616
* After test method finishes, DbTest rollbacks transaction.
1717

18-
This way database modifications are quickly restored, but requires that the table uses a transaction engine like InnoDb.
18+
This way database modifications are quickly restored, but requires that the table uses a transaction engine
19+
like InnoDb.
1920

2021
Support
2122
-------
@@ -27,11 +28,13 @@ Commercial support is also available, [contact us](http://cakedc.com/contact) fo
2728
Contributing
2829
------------
2930

30-
If you'd like to contribute new features, enhancements or bug fixes to the plugin, just read our [Contribution Guidelines](http://cakedc.com/plugins) for detailed instructions.
31+
If you'd like to contribute new features, enhancements or bug fixes to the plugin, just read our
32+
[Contribution Guidelines](http://cakedc.com/plugins) for detailed instructions.
3133

3234
License
3335
-------
3436

35-
Copyright 2007-2014 Cake Development Corporation (CakeDC). All rights reserved.
37+
Copyright 2013-2023 Cake Development Corporation (CakeDC). All rights reserved.
3638

37-
Licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.
39+
Licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) License. Redistributions of the source code included in this repository
40+
must retain the copyright notice found in each file.

Docs/Documentation/Workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Adding new fixture
55
------------------
66

77
1. Using any database modification tool (phpmysql, navicat, mysql) modify templates database.
8-
2. Execute `bin/cake fixture_import dump` this will create `config/sql/test_db.sql`
8+
2. Execute `bin/cake fixture_import` this will create `config/sql/test_db.sql`
99
3. Execute `bin/cake db_test -i` to import sql file.
1010
4. Add modified sql file into repository.
1111

@@ -15,7 +15,7 @@ Update database structure
1515
To update database structure the following steps need to beperformed:
1616

1717
1. Apply migrations for test_template database `bin/cake migrations migrate --connection test_template`
18-
2. Execute `bin/cake fixture_import dump`
18+
2. Execute `bin/cake fixture_import`
1919
3. Execute `bin/cake db_test -i` to import sql file.
2020
4. Add modified sql file into repository.
2121

Docs/Home.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The **DbTest** plugin enables developers to speeding up tests running on MySQL o
66
Requirements
77
------------
88

9-
* CakePHP 3.5+
10-
* PHP 5.6.0+
9+
* CakePHP 5.0+
10+
* PHP 8.1+
1111
* MySQL database with InnoDb engine
1212
* PostgreSQL database
13-
* Phpunit 6.*
13+
* Phpunit 10.*
1414

1515
Documentation
1616
-------------

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright 2009-2020
3+
Copyright 2009-2023
44
Cake Development Corporation
55
1785 E. Sahara Avenue, Suite 490-423
66
Las Vegas, Nevada 89104

0 commit comments

Comments
 (0)