-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Đỗ Văn Hùng <[email protected]>
- Loading branch information
1 parent
85643c0
commit 52201b9
Showing
9 changed files
with
174 additions
and
158 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
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,51 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* baserCMS : Based Website Development Project <https://basercms.net> | ||
* Copyright (c) NPO baser foundation <https://baserfoundation.org/> | ||
* | ||
* @copyright Copyright (c) NPO baser foundation | ||
* @link https://basercms.net baserCMS Project | ||
* @since 5.0.0 | ||
* @license https://basercms.net/license/index.html MIT License | ||
*/ | ||
|
||
namespace BcFavorite\Test\Factory; | ||
|
||
use CakephpFixtureFactories\Factory\BaseFactory as CakephpBaseFactory; | ||
use Faker\Generator; | ||
|
||
/** | ||
* BlogCategoryFactory | ||
*/ | ||
class FavoriteFactory extends CakephpBaseFactory | ||
{ | ||
|
||
/** | ||
* Defines the Table Registry used to generate entities with | ||
* | ||
* @return string | ||
*/ | ||
protected function getRootTableRegistryName(): string | ||
{ | ||
return 'BcFavorite.Favorites'; | ||
} | ||
|
||
/** | ||
* Defines the factory's default values. This is useful for | ||
* not nullable fields. You may use methods of the present factory here too. | ||
* | ||
* @return void | ||
*/ | ||
protected function setDefaultTemplate(): void | ||
{ | ||
$this->setDefaultData(function (Generator $faker) { | ||
return [ | ||
'created' => $faker->date(), | ||
'modified' => $faker->date() | ||
]; | ||
}); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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,71 @@ | ||
<?php | ||
/** | ||
* baserCMS : Based Website Development Project <https://basercms.net> | ||
* Copyright (c) NPO baser foundation <https://baserfoundation.org/> | ||
* | ||
* @copyright Copyright (c) NPO baser foundation | ||
* @link https://basercms.net baserCMS Project | ||
* @since 5.0.0 | ||
* @license https://basercms.net/license/index.html MIT License | ||
*/ | ||
|
||
namespace BcFavorite\Test\Scenario; | ||
|
||
use BcFavorite\Test\Factory\FavoriteFactory; | ||
use CakephpFixtureFactories\Scenario\FixtureScenarioInterface; | ||
|
||
/** | ||
* FavoritesScenario | ||
*/ | ||
class FavoritesScenario implements FixtureScenarioInterface | ||
{ | ||
|
||
/** | ||
* load | ||
*/ | ||
public function load(...$args) | ||
{ | ||
FavoriteFactory::make([ | ||
'id' => 1, | ||
'user_id' => '1', | ||
'name' => '固定ページ管理', | ||
'url' => '/admin/pages/index', | ||
'sort' => 1, | ||
])->persist(); | ||
FavoriteFactory::make([ | ||
'id' => 2, | ||
'user_id' => '1', | ||
'name' => '新着情報管理', | ||
'url' => '/admin/blog/blog_posts/index/1', | ||
'sort' => 2, | ||
])->persist(); | ||
FavoriteFactory::make([ | ||
'id' => 3, | ||
'user_id' => '1', | ||
'name' => 'お問い合わせ管理', | ||
'url' => '/admin/mail/mail_fields/index/1', | ||
'sort' => 3, | ||
])->persist(); | ||
FavoriteFactory::make([ | ||
'id' => 4, | ||
'user_id' => '1', | ||
'name' => '受信メール一覧', | ||
'url' => '/admin/mail/mail_messages/index/1', | ||
'sort' => 4, | ||
])->persist(); | ||
FavoriteFactory::make([ | ||
'id' => 5, | ||
'user_id' => '1', | ||
'name' => 'コメント一覧', | ||
'url' => '/admin/blog/blog_comments/index/1', | ||
'sort' => 5, | ||
])->persist(); | ||
FavoriteFactory::make([ | ||
'id' => 6, | ||
'user_id' => '1', | ||
'name' => 'クレジット', | ||
'url' => 'javascript:credit();', | ||
'sort' => 6, | ||
])->persist(); | ||
} | ||
} |
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
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
Oops, something went wrong.