From 90018f8feea9e218b348ad8f80bf1b222244a69b Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 09:23:46 -0700 Subject: [PATCH 01/20] Start of work on Unit Tests Signed-off-by: Justin Yost --- .travis.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fcd677d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +language: php + +sudo: false + +php: + - 5.6 + +# Environment Variables to set +env: + global: + # Contains a $GITHUB_TOKEN env var for use with composer to avoid API limits. + - secure: "G8hdRx7YHeJYc50Iw+BE1/5Z1OZRCg3sNsDRzS4jU6/pWgW7rE9R460JJhDsrYciv19SVopkHjw/hmEi2hH+HCDo0QmcFPLaQGHr9yNPOTYt9dGRPCk3yVdVSJEGeSa2w6XJ2Up5bAvWEBoBX7cLCPKbsFeYBZS6K4p4uIjPJ6o33IRdDxSsiaNJT/19zG7pKLqnf1Gu+daHzIKHekQhoMWrEKdjFS3vmk7NL1cQ4Ko/S/ekVPMhA0+ZNfQ6cHMf25LF//ZOmggcIAbzi0QRTgJy1xYSUU2eV6tdKv8WUgDi/OZpPGBIYPZ8SJ7GUsWY5GsCrHAiQRRfDS2xgIiJlav6c8u99kz8EXtnmIB2iIjx0BzkO5QsXq5qcXngQSnnac6T7LyY69qhCMAKpjWhiHmNyL/NDi8J9fbNHUG7U8dY/N9Ihac/VkAI7ffNB2kB90Potv1klNP/e70C4Z6p+aMAnm6SaI74WrhjqdiEwiM3KcbeYYl/1XOGSHgfrPSQrD1qYcVoupCrZd0lxDHaq6PavR9McomFTF4eHTiNZGvKDjWH298MwdylZwZK36CDpj7LhXuJPQmuVsQ4V+zxGTVeUsI4CyILxPFXc6Cepgl69LfBF9gbAFtJUHJ4KdXllOSrjy4Ga9w3vwEagEGWlZHX5obItETQllOZitckp0o=" + +# Services to Enable +services: + - mysql + +# Branches to be built or not +branches: + # Blacklist these branches + except: + - master + - staging + - gh-pages + +before_install: + - sh -c "composer self-update" + +install: + - sh -c "composer config -g github-oauth.github.com $GITHUB_TOKEN" + - sh -c "composer install --no-interaction" + - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ../test-app" + +before_script: + - phpenv rehash + - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' + - vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer + +script: + # - sh -c "bin/phpcs -p --extensions=php --standard=Loadsys ./src ./tests ./config ./webroot" + # - sh -c "bin/phpunit" + +notifications: + email: false From 89977ca2b7d01f42f5b9fc6a4510f44f28a9f282 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 09:31:43 -0700 Subject: [PATCH 02/20] Adding LoadsysTheme to the test app Signed-off-by: Justin Yost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index fcd677d..9adea12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ install: - sh -c "composer config -g github-oauth.github.com $GITHUB_TOKEN" - sh -c "composer install --no-interaction" - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ../test-app" + - sh -c "cd ../test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" before_script: - phpenv rehash From 37ad20f3e62eb76aa38f9ea12e15f4d8c10a5be6 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 10:40:31 -0700 Subject: [PATCH 03/20] Expirement With Importing SQL File Signed-off-by: Justin Yost --- .travis.yml | 3 ++- provision/test-app.sql | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 provision/test-app.sql diff --git a/.travis.yml b/.travis.yml index 9adea12..980b5e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,8 @@ install: before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - - vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer + - mysql travis_app < ./tests/provision/test-app.sql + - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer script: # - sh -c "bin/phpcs -p --extensions=php --standard=Loadsys ./src ./tests ./config ./webroot" diff --git a/provision/test-app.sql b/provision/test-app.sql new file mode 100644 index 0000000..496ae84 --- /dev/null +++ b/provision/test-app.sql @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS `users`; + +CREATE TABLE `users` ( + `id` varchar(36) NOT NULL COMMENT 'Primary Key for the Users Table, UUID', + `email` varchar(255) NOT NULL COMMENT 'Email Address for the User', + `password` varchar(255) NOT NULL COMMENT 'Hashed Password', + `firstname` varchar(255) NOT NULL COMMENT 'User''s given name.', + `lastname` varchar(255) NOT NULL COMMENT 'User''s family name.', + `role` varchar(50) NOT NULL COMMENT 'ENUM mocked field. See User::getList() for options.', + `is_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Bool controlling whether login is allowed or not.', + `created` datetime DEFAULT NULL COMMENT 'Created datetime', + `creator_id` varchar(36) DEFAULT NULL COMMENT 'ID of User who created row', + `modified` datetime DEFAULT NULL COMMENT 'Modified datetime', + `modifier_id` varchar(36) DEFAULT NULL COMMENT 'ID of User who modified row', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; + +INSERT INTO `users` (`id`, `email`, `password`, `firstname`, `lastname`, `role`, `is_active`, `created`, `creator_id`, `modified`, `modifier_id`) +VALUES + ('08148fbc-32ba-11e4-9e39-080027506c76','testing@localhost.com','$2a$10$sjaVf5UXC2sDgutoZ8bAjezChMvq0I8uQdaEN5evUGWW.WLfWbFES','Testing','Localhost','user',1,'2015-06-30 17:07:35','799763fd-32bc-11e4-9e39-080027506c76','2015-06-30 17:07:35','799763fd-32bc-11e4-9e39-080027506c76'), + ('54108b70-a178-4590-9df4-1a900a00020f','tester@localhost.com','$2a$10$sjaVf5UXC2sDgutoZ8bAjezChMvq0I8uQdaEN5evUGWW.WLfWbFES','Test','Localhost','user',0,'2015-06-30 17:07:35','54108b70-5e58-42dc-b384-1a900a00020f','2014-09-10 17:33:36',NULL), + ('799763fd-32bc-11e4-9e39-080027506c76','admin@localhost.com','$2a$10$sjaVf5UXC2sDgutoZ8bAjezChMvq0I8uQdaEN5evUGWW.WLfWbFES','Admin','Localhost','admin',1,'2015-06-30 17:07:35','799763fd-32bc-11e4-9e39-080027506c76','2015-06-30 17:07:35','799763fd-32bc-11e4-9e39-080027506c76'); + +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; From 8540abb499e85d67aa76e55f08f1e9461e3ea38c Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 10:45:03 -0700 Subject: [PATCH 04/20] Correct Path To Travis Provision SQL File Signed-off-by: Justin Yost --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 980b5e3..9c618a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ install: before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - - mysql travis_app < ./tests/provision/test-app.sql + - mysql travis_app < ./provision/test-app.sql - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer script: From 908f35ff56c5c1cb681560e90b843ffd70211bdc Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 10:53:25 -0700 Subject: [PATCH 05/20] Test Baking Cake Project Using Loadsys Theme Signed-off-by: Justin Yost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9c618a1..5662906 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,7 @@ before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - mysql travis_app < ./provision/test-app.sql + - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer script: From d5e5e3300ce7680f3e6f8aa7d1e0f60858f913e7 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 10:57:09 -0700 Subject: [PATCH 06/20] Catting The Test App Composer JSON File Signed-off-by: Justin Yost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5662906..1f960ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ install: - sh -c "composer install --no-interaction" - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ../test-app" - sh -c "cd ../test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" + - sh -c "cat ../test-app/composer.json" before_script: - phpenv rehash From db4a3ff7ebfe31e40a8b695111ef5b85b3ef94fe Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:03:46 -0700 Subject: [PATCH 07/20] Work In Progress On Baking Project Signed-off-by: Justin Yost --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f960ce..fcbb9bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,11 +37,12 @@ before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - mysql travis_app < ./provision/test-app.sql - - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" - - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer + - sh -c "cd ../test-app; ./bin/cake bake.bake --help" + # - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" + # - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer script: - # - sh -c "bin/phpcs -p --extensions=php --standard=Loadsys ./src ./tests ./config ./webroot" + # - sh -c "bin/phpcs -p --extensions=php,ctp --standard=Loadsys ../test-app/src ../test-app/tests ../test-app/config ../test-app/webroot" # - sh -c "bin/phpunit" notifications: From 84965222d90c52b14c94d08534d6463a14492e01 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:15:49 -0700 Subject: [PATCH 08/20] Update to add the LoadsysTheme Plugin to the App Signed-off-by: Justin Yost --- .travis.yml | 2 +- provision/bootstrap-append.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 provision/bootstrap-append.txt diff --git a/.travis.yml b/.travis.yml index fcbb9bb..44cece0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: - sh -c "composer install --no-interaction" - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ../test-app" - sh -c "cd ../test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - - sh -c "cat ../test-app/composer.json" + - sh -c "cat ./provision/append.txt >> ../test-app/config/bootstrap.php" before_script: - phpenv rehash diff --git a/provision/bootstrap-append.txt b/provision/bootstrap-append.txt new file mode 100644 index 0000000..bcc5843 --- /dev/null +++ b/provision/bootstrap-append.txt @@ -0,0 +1,3 @@ + + +Plugin::load('LoadsysTheme'); From 30af6383b5f6b8d0d9c0ae1349d05d75a51844b4 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:17:20 -0700 Subject: [PATCH 09/20] Add Text Informing About Updating The bootstrap.php File Closes #14 Signed-off-by: Justin Yost --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 88e5ea4..5b0aca7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ $ composer require loadsys/cakephp-loadsys-theme:dev-master * Add this plugin to your application by adding this line to your bootstrap.php +```php +Plugin::load('LoadsysTheme'); +``` + +* Use this Theme when baking content via the `--theme` option for the `bake` command like so: + ````bash $ ./vendor/bin/cake bake all --theme LoadsysTheme name-of-thing ```` From 41c075c4ae92767056eb32f44ffe6e9317699877 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:24:18 -0700 Subject: [PATCH 10/20] Updated File Paths for Travis Builds Signed-off-by: Justin Yost --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 44cece0..5f43c0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,15 +29,15 @@ before_install: install: - sh -c "composer config -g github-oauth.github.com $GITHUB_TOKEN" - sh -c "composer install --no-interaction" - - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ../test-app" - - sh -c "cd ../test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - - sh -c "cat ./provision/append.txt >> ../test-app/config/bootstrap.php" + - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/loadsys/test-app" + - sh -c "cd ~/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" + - sh -c "cat ~/loadsys/CakePHP-LoadsysTheme/provision/append.txt >> ~/loadsys/test-app/config/bootstrap.php" before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - - mysql travis_app < ./provision/test-app.sql - - sh -c "cd ../test-app; ./bin/cake bake.bake --help" + - mysql travis_app < ~/loadsys/test-app/CakePHP-LoadsysTheme/provision/test-app.sql + - sh -c "~/loadsys/test-app/bin/cake bake.bake --help" # - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" # - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer From 3c132720e59d955b6e403812cea6d75d211a58dc Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:27:12 -0700 Subject: [PATCH 11/20] Corrects Path To Append Text File Signed-off-by: Justin Yost --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f43c0c..e9aed55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: - sh -c "composer install --no-interaction" - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/loadsys/test-app" - sh -c "cd ~/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - - sh -c "cat ~/loadsys/CakePHP-LoadsysTheme/provision/append.txt >> ~/loadsys/test-app/config/bootstrap.php" + - sh -c "cat ~/loadsys/CakePHP-LoadsysTheme/provision/bootstrap-append.txt >> ~/loadsys/test-app/config/bootstrap.php" before_script: - phpenv rehash From 8d56b3df9f7906210ab92ccd36c8f81a58a367f6 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:31:06 -0700 Subject: [PATCH 12/20] More Work On Updating Paths To Files Signed-off-by: Justin Yost --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9aed55..20f4b75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,15 +29,15 @@ before_install: install: - sh -c "composer config -g github-oauth.github.com $GITHUB_TOKEN" - sh -c "composer install --no-interaction" - - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/loadsys/test-app" - - sh -c "cd ~/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - - sh -c "cat ~/loadsys/CakePHP-LoadsysTheme/provision/bootstrap-append.txt >> ~/loadsys/test-app/config/bootstrap.php" + - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/build/loadsys/test-app" + - sh -c "cd ~/build/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" + - sh -c "cat ~/build/loadsys/CakePHP-LoadsysTheme/provision/bootstrap-append.txt >> ~/build/loadsys/test-app/config/bootstrap.php" before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - - mysql travis_app < ~/loadsys/test-app/CakePHP-LoadsysTheme/provision/test-app.sql - - sh -c "~/loadsys/test-app/bin/cake bake.bake --help" + - mysql travis_app < ~/build/loadsys/test-app/CakePHP-LoadsysTheme/provision/test-app.sql + - sh -c "~/build/loadsys/test-app/bin/cake bake.bake --help" # - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" # - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer From f0dbd66a40a2f0f10d11830e70c2d01eb29f7be8 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:33:27 -0700 Subject: [PATCH 13/20] More Corrections of file paths Signed-off-by: Justin Yost --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 20f4b75..6bb958e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ install: before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - - mysql travis_app < ~/build/loadsys/test-app/CakePHP-LoadsysTheme/provision/test-app.sql + - mysql travis_app < ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.sql - sh -c "~/build/loadsys/test-app/bin/cake bake.bake --help" # - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" # - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer From 9a39f8e9f6cc7654f77dbc750c7acae705e34a09 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:38:30 -0700 Subject: [PATCH 14/20] Add Baking Project Process Signed-off-by: Justin Yost --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6bb958e..c64eab1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,9 +37,8 @@ before_script: - phpenv rehash - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - mysql travis_app < ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.sql - - sh -c "~/build/loadsys/test-app/bin/cake bake.bake --help" - # - sh -c "cd ../test-app; ./bin/cake bake.bake all --everything -t LoadsysTheme" - # - ../test-app/vendor/bin/phpcs --config-set installed_paths vendor/loadsys/loadsys_codesniffer,vendor/cakephp/cakephp-codesniffer + - sh -c "~/build/loadsys/test-app/bin/cake bake.bake all --everything -t LoadsysTheme" + - ~/build/loadsys/test-app/vendor/bin/phpcs --config-set installed_paths ~/build/loadsys/test-app/vendor/loadsys/loadsys_codesniffer,~/build/loadsys/test-app/vendor/cakephp/cakephp-codesniffer script: # - sh -c "bin/phpcs -p --extensions=php,ctp --standard=Loadsys ../test-app/src ../test-app/tests ../test-app/config ../test-app/webroot" From 0ac6a3407c5abbe6215de1ec18904420960f8281 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:38:51 -0700 Subject: [PATCH 15/20] Add Code Sniffer As The Script Signed-off-by: Justin Yost --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c64eab1..0765bdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,7 @@ before_script: - ~/build/loadsys/test-app/vendor/bin/phpcs --config-set installed_paths ~/build/loadsys/test-app/vendor/loadsys/loadsys_codesniffer,~/build/loadsys/test-app/vendor/cakephp/cakephp-codesniffer script: - # - sh -c "bin/phpcs -p --extensions=php,ctp --standard=Loadsys ../test-app/src ../test-app/tests ../test-app/config ../test-app/webroot" - # - sh -c "bin/phpunit" + - sh -c "~/build/loadsys/test-app/bin/phpcs -p --extensions=php,ctp --standard=Loadsys ~/build/loadsys/test-app/src ~/build/loadsys/test-app/tests ~/build/loadsys/test-app/config ~/build/loadsys/test-app/webroot" notifications: email: false From da158dc58e68d52d60b48c5e6d67e2b83682e449 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:44:02 -0700 Subject: [PATCH 16/20] Add Replacement app.php Config File For The Test App Signed-off-by: Justin Yost --- .travis.yml | 1 + provision/test-app.php | 318 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 319 insertions(+) create mode 100644 provision/test-app.php diff --git a/.travis.yml b/.travis.yml index 0765bdc..7f21d08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ install: - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/build/loadsys/test-app" - sh -c "cd ~/build/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - sh -c "cat ~/build/loadsys/CakePHP-LoadsysTheme/provision/bootstrap-append.txt >> ~/build/loadsys/test-app/config/bootstrap.php" + - sh -c "mv ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.php >> ~/build/loadsys/test-app/config/app.php" before_script: - phpenv rehash diff --git a/provision/test-app.php b/provision/test-app.php new file mode 100644 index 0000000..9bfd05c --- /dev/null +++ b/provision/test-app.php @@ -0,0 +1,318 @@ + true, + + /** + * Configure basic information about the application. + * + * - namespace - The namespace to find app classes under. + * - encoding - The encoding used for HTML + database connections. + * - base - The base directory the app resides in. If false this + * will be auto detected. + * - dir - Name of app directory. + * - webroot - The webroot directory. + * - wwwRoot - The file path to webroot. + * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to + * use CakePHP pretty URLs, remove these .htaccess + * files: + * /.htaccess + * /webroot/.htaccess + * And uncomment the baseUrl key below. + * - fullBaseUrl - A base URL to use for absolute links. + * - imageBaseUrl - Web path to the public images directory under webroot. + * - cssBaseUrl - Web path to the public css directory under webroot. + * - jsBaseUrl - Web path to the public js directory under webroot. + * - paths - Configure paths for non class based resources. Supports the + * `plugins`, `templates`, `locales` subkeys, which allow the definition of + * paths for plugins, view templates and locale files respectively. + */ + 'App' => [ + 'namespace' => 'App', + 'encoding' => 'UTF-8', + 'base' => false, + 'dir' => 'src', + 'webroot' => 'webroot', + 'wwwRoot' => WWW_ROOT, + // 'baseUrl' => env('SCRIPT_NAME'), + 'fullBaseUrl' => false, + 'imageBaseUrl' => 'img/', + 'cssBaseUrl' => 'css/', + 'jsBaseUrl' => 'js/', + 'paths' => [ + 'plugins' => [ROOT . DS . 'plugins' . DS], + 'templates' => [APP . 'Template' . DS], + 'locales' => [APP . 'Locale' . DS], + ], + ], + + /** + * Security and encryption configuration + * + * - salt - A random string used in security hashing methods. + * The salt value is also used as the encryption key. + * You should treat it as extremely sensitive data. + */ + 'Security' => [ + 'salt' => 'd8bac450f2fc705d9f9be4d8b04fa2aef73c6fa3356baf240325e0b66312a9e5', + ], + + /** + * Apply timestamps with the last modified time to static assets (js, css, images). + * Will append a querystring parameter containing the time the file was modified. + * This is useful for busting browser caches. + * + * Set to true to apply timestamps when debug is true. Set to 'force' to always + * enable timestamping regardless of debug value. + */ + 'Asset' => [ + // 'timestamp' => true, + ], + + /** + * Configure the cache adapters. + */ + 'Cache' => [ + 'default' => [ + 'className' => 'File', + 'path' => CACHE, + ], + + /** + * Configure the cache used for general framework caching. Path information, + * object listings, and translation cache files are stored with this + * configuration. + */ + '_cake_core_' => [ + 'className' => 'File', + 'prefix' => 'myapp_cake_core_', + 'path' => CACHE . 'persistent/', + 'serialize' => true, + 'duration' => '+2 minutes', + ], + + /** + * Configure the cache for model and datasource caches. This cache + * configuration is used to store schema descriptions, and table listings + * in connections. + */ + '_cake_model_' => [ + 'className' => 'File', + 'prefix' => 'myapp_cake_model_', + 'path' => CACHE . 'models/', + 'serialize' => true, + 'duration' => '+2 minutes', + ], + ], + + /** + * Configure the Error and Exception handlers used by your application. + * + * By default errors are displayed using Debugger, when debug is true and logged + * by Cake\Log\Log when debug is false. + * + * In CLI environments exceptions will be printed to stderr with a backtrace. + * In web environments an HTML page will be displayed for the exception. + * With debug true, framework errors like Missing Controller will be displayed. + * When debug is false, framework errors will be coerced into generic HTTP errors. + * + * Options: + * + * - `errorLevel` - int - The level of errors you are interested in capturing. + * - `trace` - boolean - Whether or not backtraces should be included in + * logged errors/exceptions. + * - `log` - boolean - Whether or not you want exceptions logged. + * - `exceptionRenderer` - string - The class responsible for rendering + * uncaught exceptions. If you choose a custom class you should place + * the file for that class in src/Error. This class needs to implement a + * render method. + * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that + * extend one of the listed exceptions will also be skipped for logging. + * E.g.: + * `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']` + */ + 'Error' => [ + 'errorLevel' => E_ALL & ~E_DEPRECATED, + 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', + 'skipLog' => [], + 'log' => true, + 'trace' => true, + ], + + /** + * Email configuration. + * + * You can configure email transports and email delivery profiles here. + * + * By defining transports separately from delivery profiles you can easily + * re-use transport configuration across multiple profiles. + * + * You can specify multiple configurations for production, development and + * testing. + * + * ### Configuring transports + * + * Each transport needs a `className`. Valid options are as follows: + * + * Mail - Send using PHP mail function + * Smtp - Send using SMTP + * Debug - Do not send the email, just return the result + * + * You can add custom transports (or override existing transports) by adding the + * appropriate file to src/Network/Email. Transports should be named + * 'YourTransport.php', where 'Your' is the name of the transport. + * + * ### Configuring delivery profiles + * + * Delivery profiles allow you to predefine various properties about email + * messages from your application and give the settings a name. This saves + * duplication across your application and makes maintenance and development + * easier. Each profile accepts a number of keys. See `Cake\Network\Email\Email` + * for more information. + */ + 'EmailTransport' => [ + 'default' => [ + 'className' => 'Mail', + // The following keys are used in SMTP transports + 'host' => 'localhost', + 'port' => 25, + 'timeout' => 30, + 'username' => 'user', + 'password' => 'secret', + 'client' => null, + 'tls' => null, + ], + ], + + 'Email' => [ + 'default' => [ + 'transport' => 'default', + 'from' => 'you@localhost', + //'charset' => 'utf-8', + //'headerCharset' => 'utf-8', + ], + ], + + /** + * Connection information used by the ORM to connect + * to your application's datastores. + * Drivers include Mysql Postgres Sqlite Sqlserver + * See vendor\cakephp\cakephp\src\Database\Driver for complete list + */ + 'Datasources' => [ + 'default' => [ + 'className' => 'Cake\Database\Connection', + 'driver' => 'Cake\Database\Driver\Mysql', + 'persistent' => false, + 'host' => '0.0.0.0', + 'username' => 'travis', + 'password' => '', + 'database' => 'travis_app', + 'encoding' => 'utf8', + 'timezone' => 'UTC', + 'cacheMetadata' => true, + + /* + * Set identifier quoting to true if you are using reserved words or + * special characters in your table or column names. Enabling this + * setting will result in queries built using the Query Builder having + * identifiers quoted when creating SQL. It should be noted that this + * decreases performance because each query needs to be traversed and + * manipulated before being executed. + */ + 'quoteIdentifiers' => false, + + /* + * During development, if using MySQL < 5.6, uncommenting the + * following line could boost the speed at which schema metadata is + * fetched from the database. It can also be set directly with the + * mysql configuration directive 'innodb_stats_on_metadata = 0' + * which is the recommended value in production environments + * 'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], + */ + ], + + /** + * The test connection is used during the test suite. + */ + 'test' => [ + 'className' => 'Cake\Database\Connection', + 'driver' => 'Cake\Database\Driver\Mysql', + 'persistent' => false, + 'host' => '0.0.0.0', + 'username' => 'travis', + 'password' => '', + 'database' => 'travis_app', + 'encoding' => 'utf8', + 'timezone' => 'UTC', + 'cacheMetadata' => true, + 'quoteIdentifiers' => false, + ], + ], + + /** + * Configures logging options + */ + 'Log' => [ + 'debug' => [ + 'className' => 'Cake\Log\Engine\FileLog', + 'path' => LOGS, + 'file' => 'debug', + 'levels' => ['notice', 'info', 'debug'], + ], + 'error' => [ + 'className' => 'Cake\Log\Engine\FileLog', + 'path' => LOGS, + 'file' => 'error', + 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], + ], + ], + + /** + * + * Session configuration. + * + * Contains an array of settings to use for session configuration. The + * `defaults` key is used to define a default preset to use for sessions, any + * settings declared here will override the settings of the default config. + * + * ## Options + * + * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. + * - `cookiePath` - The url path for which session cookie is set. Maps to the + * `session.cookie_path` php.ini config. Defaults to base path of app. + * - `timeout` - The time in minutes the session should be valid for. + * Pass 0 to disable checking timeout. + * - `defaults` - The default configuration set to use as a basis for your session. + * There are four built-in options: php, cake, cache, database. + * - `handler` - Can be used to enable a custom session handler. Expects an + * array with at least the `engine` key, being the name of the Session engine + * class to use for managing the session. CakePHP bundles the `CacheSession` + * and `DatabaseSession` engines. + * - `ini` - An associative array of additional ini values to set. + * + * The built-in `defaults` options are: + * + * - 'php' - Uses settings defined in your php.ini. + * - 'cake' - Saves session files in CakePHP's /tmp directory. + * - 'database' - Uses CakePHP's database sessions. + * - 'cache' - Use the Cache class to save sessions. + * + * To define a custom session handler, save it at src/Network/Session/.php. + * Make sure the class implements PHP's `SessionHandlerInterface` and set + * Session.handler to + * + * To use database sessions, load the SQL file located at config/Schema/sessions.sql + */ + 'Session' => [ + 'defaults' => 'php', + ], +]; From 93a0f9e7e659b32f6fa2635f75e524eaf24b4fff Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:45:49 -0700 Subject: [PATCH 17/20] Correcting Move Script Signed-off-by: Justin Yost --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f21d08..c76041f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ install: - sh -c "composer create-project --no-interaction --prefer-dist cakephp/app ~/build/loadsys/test-app" - sh -c "cd ~/build/loadsys/test-app ; composer require loadsys/cakephp-loadsys-theme:dev-master;" - sh -c "cat ~/build/loadsys/CakePHP-LoadsysTheme/provision/bootstrap-append.txt >> ~/build/loadsys/test-app/config/bootstrap.php" - - sh -c "mv ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.php >> ~/build/loadsys/test-app/config/app.php" + - sh -c "mv ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.php ~/build/loadsys/test-app/config/app.php" before_script: - phpenv rehash From c228b46cece9871b1f03f12ac5eb4481e46957c2 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 11:48:42 -0700 Subject: [PATCH 18/20] Correcting Path To PHPCS Bin File Signed-off-by: Justin Yost --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c76041f..ec7b204 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ before_script: - ~/build/loadsys/test-app/vendor/bin/phpcs --config-set installed_paths ~/build/loadsys/test-app/vendor/loadsys/loadsys_codesniffer,~/build/loadsys/test-app/vendor/cakephp/cakephp-codesniffer script: - - sh -c "~/build/loadsys/test-app/bin/phpcs -p --extensions=php,ctp --standard=Loadsys ~/build/loadsys/test-app/src ~/build/loadsys/test-app/tests ~/build/loadsys/test-app/config ~/build/loadsys/test-app/webroot" + - sh -c "~/build/loadsys/test-app/vendor/bin/phpcs -p --extensions=php,ctp --standard=Loadsys ~/build/loadsys/test-app/src ~/build/loadsys/test-app/tests ~/build/loadsys/test-app/config ~/build/loadsys/test-app/webroot" notifications: email: false From a727041cb48b993d1ecb838701ea7b748c5f51a1 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 12:00:41 -0700 Subject: [PATCH 19/20] Verifying Installed Paths and Standards Installed Signed-off-by: Justin Yost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ec7b204..5f04c47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ before_script: - mysql travis_app < ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.sql - sh -c "~/build/loadsys/test-app/bin/cake bake.bake all --everything -t LoadsysTheme" - ~/build/loadsys/test-app/vendor/bin/phpcs --config-set installed_paths ~/build/loadsys/test-app/vendor/loadsys/loadsys_codesniffer,~/build/loadsys/test-app/vendor/cakephp/cakephp-codesniffer + - ~/build/loadsys/test-app/vendor/bin/phpcs -i script: - sh -c "~/build/loadsys/test-app/vendor/bin/phpcs -p --extensions=php,ctp --standard=Loadsys ~/build/loadsys/test-app/src ~/build/loadsys/test-app/tests ~/build/loadsys/test-app/config ~/build/loadsys/test-app/webroot" From 7413157b09f596903cc677a2f785aced55277bd1 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Thu, 2 Jul 2015 12:06:05 -0700 Subject: [PATCH 20/20] Listing Test App CakePHP Vendor Directory Signed-off-by: Justin Yost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5f04c47..12c1802 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ before_script: - mysql -e 'DROP DATABASE IF EXISTS `travis_app`; CREATE DATABASE `travis_app`;' - mysql travis_app < ~/build/loadsys/CakePHP-LoadsysTheme/provision/test-app.sql - sh -c "~/build/loadsys/test-app/bin/cake bake.bake all --everything -t LoadsysTheme" + - ls ~/build/loadsys/test-app/vendor/cakephp/ - ~/build/loadsys/test-app/vendor/bin/phpcs --config-set installed_paths ~/build/loadsys/test-app/vendor/loadsys/loadsys_codesniffer,~/build/loadsys/test-app/vendor/cakephp/cakephp-codesniffer - ~/build/loadsys/test-app/vendor/bin/phpcs -i