From 3d684b35ad74afbed916604f90e60262d4dac412 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 4 Aug 2019 22:54:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20test:=20UniteTest=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20https://github.com/NetCommons3/NetCommons3/issues/1468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Case/Config/RoutesTest.php | 99 ------------------- .../EditTest.php | 2 +- .../CabinetBlocksController/EditTest.php | 4 +- Test/Case/Model/Cabinet/SaveCabinetTest.php | 4 +- 4 files changed, 5 insertions(+), 104 deletions(-) delete mode 100644 Test/Case/Config/RoutesTest.php diff --git a/Test/Case/Config/RoutesTest.php b/Test/Case/Config/RoutesTest.php deleted file mode 100644 index 8a1a621..0000000 --- a/Test/Case/Config/RoutesTest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @author Shohei Nakajima - * @link http://www.netcommons.org NetCommons Project - * @license http://www.netcommons.org/license.txt NetCommons License - * @copyright Copyright 2014, NetCommons Project - */ - -App::uses('NetCommonsRoutesTestCase', 'NetCommons.TestSuite'); - -/** - * Config/routes.phpのテスト - * - * @author Shohei Nakajima - * @package NetCommons\Pages\Test\Case\Routing\Route\SlugRoute - */ -class RoutesTest extends NetCommonsRoutesTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array(); - -/** - * Plugin name - * - * @var string - */ - public $plugin = 'cabinets'; - -/** - * DataProvider - * - * ### 戻り値 - * - url URL - * - expected 期待値 - * - * @return array テストデータ - */ - public function dataProvider() { - return array( - array( - 'url' => '/cabinets/cabinet_files/index/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'index', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/cabinets/cabinet_files/folder_detail/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'folder_detail', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/cabinets/cabinet_files/view/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'view', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/cabinets/cabinet_files/download/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'download', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/cabinets/cabinet_files/download_folder/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'download_folder', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/cabinets/cabinet_files_edit/edit/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files_edit', 'action' => 'edit', - 'block_id' => '1', 'key' => 'content_key' - ) - ), - array( - 'url' => '/cabinets/cabinet_files_edit/edit_folder/1/content_key', - 'expected' => array( - 'plugin' => 'cabinets', 'controller' => 'cabinet_files_edit', 'action' => 'edit_folder', - 'block_id' => '1', 'key' => 'content_key' - ) - ), - ); - } - -} diff --git a/Test/Case/Controller/CabinetBlockRolePermissionsController/EditTest.php b/Test/Case/Controller/CabinetBlockRolePermissionsController/EditTest.php index be8e932..7081417 100644 --- a/Test/Case/Controller/CabinetBlockRolePermissionsController/EditTest.php +++ b/Test/Case/Controller/CabinetBlockRolePermissionsController/EditTest.php @@ -72,7 +72,7 @@ private function __data() { 'CabinetSetting' => array( 'id' => 2, 'cabinet_key' => 'cabinet_key_2', - 'use_workflow' => true, + 'use_workflow' => '1', //'use_comment_approval' => true, //'approval_type' => true, ) diff --git a/Test/Case/Controller/CabinetBlocksController/EditTest.php b/Test/Case/Controller/CabinetBlocksController/EditTest.php index 8e183eb..48005a4 100644 --- a/Test/Case/Controller/CabinetBlocksController/EditTest.php +++ b/Test/Case/Controller/CabinetBlocksController/EditTest.php @@ -65,8 +65,8 @@ private function __data($isEdit) { $frameId = '6'; //$frameKey = 'frame_3'; if ($isEdit) { - $blockId = '4'; - $blockKey = 'block_2'; + $blockId = '2'; + $blockKey = 'block_1'; $cabinetId = '3'; $cabinetKey = 'cabinet_key_2'; } else { diff --git a/Test/Case/Model/Cabinet/SaveCabinetTest.php b/Test/Case/Model/Cabinet/SaveCabinetTest.php index 3db129a..1b77b35 100644 --- a/Test/Case/Model/Cabinet/SaveCabinetTest.php +++ b/Test/Case/Model/Cabinet/SaveCabinetTest.php @@ -62,8 +62,8 @@ public function setUp() { Current::$current['Block']['id'] = '2'; Current::$current['Room']['id'] = '1'; - Current::$current['Permission']['content_editable']['value'] = true; - Current::$current['Permission']['content_publishable']['value'] = true; + Current::writePermission('1', 'content_editable', true); + Current::writePermission('1', 'content_publishable', true); } /** From ba8531a1b0de4b6e5871b766bc8684a2d903ce70 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 4 Aug 2019 23:24:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?add:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index af3b7b8..99022da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,10 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false +dist: trusty env: matrix: