Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert fixture task to use bake_compare
- Loading branch information
Showing
7 changed files
with
268 additions
and
17 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
tests/bake_compare/test/Fixture/ArticleAlternateConnectionFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticleFixture | ||
* | ||
*/ | ||
class ArticleFixture extends TestFixture { | ||
|
||
/** | ||
* Import | ||
* | ||
* @var array | ||
*/ | ||
public $import = ['model' => 'Article', 'connection' => 'test']; | ||
|
||
/** | ||
* Records | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
[ | ||
'id' => 1, | ||
'author_id' => 1, | ||
'title' => 'Lorem ipsum dolor sit amet', | ||
'body' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', | ||
'published' => 'Lorem ipsum dolor sit ame' | ||
], | ||
]; | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
tests/bake_compare/test/Fixture/ArticleBinaryTestFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticleFixture | ||
* | ||
*/ | ||
class ArticleFixture extends TestFixture { | ||
|
||
/** | ||
* Table name | ||
* | ||
* @var string | ||
*/ | ||
public $table = 'binary_tests'; | ||
|
||
/** | ||
* Fields | ||
* | ||
* @var array | ||
*/ | ||
public $fields = [ | ||
'id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null], | ||
'data' => ['type' => 'binary', 'length' => null, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null], | ||
'_constraints' => [ | ||
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], | ||
], | ||
]; | ||
|
||
/** | ||
* Records | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
[ | ||
'id' => 1, | ||
'data' => 'Lorem ipsum dolor sit amet' | ||
], | ||
]; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
tests/bake_compare/test/Fixture/ArticleCommentsFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticleFixture | ||
* | ||
*/ | ||
class ArticleFixture extends TestFixture { | ||
|
||
/** | ||
* Table name | ||
* | ||
* @var string | ||
*/ | ||
public $table = 'comments'; | ||
|
||
/** | ||
* Import | ||
* | ||
* @var array | ||
*/ | ||
public $import = ['model' => 'Article', 'records' => true, 'connection' => 'test']; | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
tests/bake_compare/test/Fixture/ArticleDatatypesFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticleFixture | ||
* | ||
*/ | ||
class ArticleFixture extends TestFixture { | ||
|
||
/** | ||
* Table name | ||
* | ||
* @var string | ||
*/ | ||
public $table = 'datatypes'; | ||
|
||
/** | ||
* Fields | ||
* | ||
* @var array | ||
*/ | ||
public $fields = [ | ||
'id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null], | ||
'decimal_field' => ['type' => 'decimal', 'length' => null, 'unsigned' => false, 'null' => true, 'default' => '0.000', 'precision' => null, 'comment' => null], | ||
'float_field' => ['type' => 'float', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null], | ||
'huge_int' => ['type' => 'biginteger', 'length' => null, 'unsigned' => false, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null, 'autoIncrement' => null], | ||
'bool' => ['type' => 'boolean', 'length' => null, 'null' => false, 'default' => 'FALSE', 'precision' => null, 'comment' => null], | ||
'_constraints' => [ | ||
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], | ||
], | ||
]; | ||
|
||
/** | ||
* Records | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
[ | ||
'id' => 1, | ||
'decimal_field' => '', | ||
'float_field' => 1, | ||
'huge_int' => '', | ||
'bool' => 1 | ||
], | ||
]; | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
tests/bake_compare/test/Fixture/ArticleImportWithConditionsFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticlesFixture | ||
* | ||
*/ | ||
class ArticlesFixture extends TestFixture { | ||
|
||
/** | ||
* Import | ||
* | ||
* @var array | ||
*/ | ||
public $import = ['model' => 'Articles', 'connection' => 'test']; | ||
|
||
/** | ||
* Records | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
[ | ||
'id' => 1, | ||
'author_id' => 1, | ||
'title' => 'First Article', | ||
'body' => 'First Article Body', | ||
'published' => 'Y' | ||
], | ||
[ | ||
'id' => 2, | ||
'author_id' => 3, | ||
'title' => 'Second Article', | ||
'body' => 'Second Article Body', | ||
'published' => 'Y' | ||
], | ||
[ | ||
'id' => 3, | ||
'author_id' => 1, | ||
'title' => 'Third Article', | ||
'body' => 'Third Article Body', | ||
'published' => 'Y' | ||
], | ||
]; | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
tests/bake_compare/test/Fixture/ArticleNoEscapingFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
namespace App\Test\Fixture; | ||
|
||
use Cake\TestSuite\Fixture\TestFixture; | ||
|
||
/** | ||
* ArticleFixture | ||
* | ||
*/ | ||
class ArticleFixture extends TestFixture { | ||
|
||
/** | ||
* Import | ||
* | ||
* @var array | ||
*/ | ||
public $import = ['model' => 'Article', 'connection' => 'test']; | ||
|
||
/** | ||
* Records | ||
* | ||
* @var array | ||
*/ | ||
public $records = [ | ||
[ | ||
'id' => 1, | ||
'author_id' => 1, | ||
'title' => 'First Article', | ||
'body' => 'Body "value"', | ||
'published' => 'Y' | ||
], | ||
[ | ||
'id' => 2, | ||
'author_id' => 3, | ||
'title' => 'Second Article', | ||
'body' => 'Body "value"', | ||
'published' => 'Y' | ||
], | ||
[ | ||
'id' => 3, | ||
'author_id' => 1, | ||
'title' => 'Third Article', | ||
'body' => 'Body "value"', | ||
'published' => 'Y' | ||
], | ||
]; | ||
|
||
} |