From 56b201d41d1130282f5d17e45b682cba4cb62c78 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 19 Feb 2023 21:13:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test:=20github=20action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From 1d91e6a9a40b8c890cf8864c5fbe95aefcfda709 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 19 Feb 2023 21:14:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test:=20PHPUnit=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetMenuFrameSettingTest.php | 2 ++ .../SaveMenuFrameSettingTest.php | 1 + Test/Case/Model/MenuFrameSetting/SaveTest.php | 1 + Test/Fixture/MenuFrameSettingFixture.php | 34 ++++++++----------- Test/Fixture/MenuFramesPageFixture.php | 31 ++++++----------- Test/Fixture/MenuFramesRoomFixture.php | 30 ++++++---------- 6 files changed, 39 insertions(+), 60 deletions(-) diff --git a/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php b/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php index 12c3e7c..344b248 100644 --- a/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php +++ b/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php @@ -66,6 +66,7 @@ public function dataProvider() { 'id' => '2', 'frame_key' => 'frame_2', 'display_type' => 'major', + 'is_private_room_hidden' => null, 'created_user' => null, 'created' => null, 'modified_user' => null, @@ -74,6 +75,7 @@ public function dataProvider() { array('frameKey' => 'frame_8', 'expected' => array( 'frame_key' => 'frame_8', 'display_type' => 'major', + 'is_private_room_hidden' => null, 'created_user' => null, 'created' => null, 'modified_user' => null, diff --git a/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php b/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php index f45155d..ca34f35 100644 --- a/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php +++ b/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php @@ -63,6 +63,7 @@ private function __data() { 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), ); diff --git a/Test/Case/Model/MenuFrameSetting/SaveTest.php b/Test/Case/Model/MenuFrameSetting/SaveTest.php index 59f2aab..c93246c 100644 --- a/Test/Case/Model/MenuFrameSetting/SaveTest.php +++ b/Test/Case/Model/MenuFrameSetting/SaveTest.php @@ -63,6 +63,7 @@ private function __data() { 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), 'Menus' => array( 1 => array( diff --git a/Test/Fixture/MenuFrameSettingFixture.php b/Test/Fixture/MenuFrameSettingFixture.php index 6f13ec5..e09e084 100644 --- a/Test/Fixture/MenuFrameSettingFixture.php +++ b/Test/Fixture/MenuFrameSettingFixture.php @@ -17,25 +17,6 @@ */ class MenuFrameSettingFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary', 'comment' => 'ID'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'フレームKey', 'charset' => 'utf8'), - 'display_type' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'bootstrap navi type', 'charset' => 'utf8'), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者'), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -46,27 +27,42 @@ class MenuFrameSettingFixture extends CakeTestFixture { 'id' => '1', 'frame_key' => 'frame_1', 'display_type' => 'header', + 'is_private_room_hidden' => null, ), array( 'id' => '2', 'frame_key' => 'frame_2', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), array( 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), array( 'id' => '4', 'frame_key' => 'frame_4', 'display_type' => 'minor', + 'is_private_room_hidden' => null, ), array( 'id' => '5', 'frame_key' => 'frame_5', 'display_type' => 'footer', + 'is_private_room_hidden' => null, ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } } diff --git a/Test/Fixture/MenuFramesPageFixture.php b/Test/Fixture/MenuFramesPageFixture.php index bed6072..c78ae31 100644 --- a/Test/Fixture/MenuFramesPageFixture.php +++ b/Test/Fixture/MenuFramesPageFixture.php @@ -17,27 +17,6 @@ */ class MenuFramesPageFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'page_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'is_hidden' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'folder_type' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者'), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -53,4 +32,14 @@ class MenuFramesPageFixture extends CakeTestFixture { ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } } diff --git a/Test/Fixture/MenuFramesRoomFixture.php b/Test/Fixture/MenuFramesRoomFixture.php index d4da9a3..e8c5437 100644 --- a/Test/Fixture/MenuFramesRoomFixture.php +++ b/Test/Fixture/MenuFramesRoomFixture.php @@ -17,26 +17,6 @@ */ class MenuFramesRoomFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'is_hidden' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者 | '), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者 | '), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -51,4 +31,14 @@ class MenuFramesRoomFixture extends CakeTestFixture { ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } }