Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set up travis-ci integration

  • Loading branch information...
commit bb3a1a73baa58194eee0f233a5ce1fcabb3674f7 1 parent 829b665
@adamlundrigan adamlundrigan authored
View
11 .travis.yml
@@ -10,10 +10,15 @@ before_script:
- cd ZendSkeletonApplication
- git clone --recursive git://github.com/ZF-Commons/ZfcUser.git vendor/ZfcUser
- git clone --recursive git://github.com/ZF-Commons/ZfcBase.git vendor/ZfcBase
- - git clone --recursive git://github.com/cdli/CdliTwoStageSignup.git vendor/CdliTwoStageSignup
- - rm config/application.config.php && cp ../CdliTwoStageSignup/.travis/application.config.php config/
- - rm ../CdliTwoStageSignup/tests/config/database.local.config.php && cp ../CdliTwoStageSignup/.travis/database.local.config.php ../CdliTwoStageSignup/tests/config/database.local.config.php
+ - cd vendor && mv ~/builds/cdli/CdliTwoStageSignup . && cd - >/dev/null
+ - cp vendor/CdliTwoStageSignup/.travis/application.config.php config/
+ - cp vendor/CdliTwoStageSignup/.travis/database.local.config.php config/autoload/
+ - cp vendor/CdliTwoStageSignup/.travis/module.zfcuser.config.php config/autoload/
+ - cp vendor/CdliTwoStageSignup/.travis/module.cdlitwostagesignup.config.php config/autoload/
- cp vendor/CdliTwoStageSignup/tests/phpunit.xml.dist vendor/CdliTwoStageSignup/tests/phpunit.xml
+ - mysql -e 'create database travis_test'
+ - mysql -u root travis_test < vendor/CdliTwoStageSignup/data/schema_up.mysql.sql
+ - mysql -e 'show tables FROM travis_test'
script:
- cd vendor/CdliTwoStageSignup/tests
View
9 .travis/database.local.config.php
@@ -1,13 +1,20 @@
<?php
return array(
+ 'cdli-twostagesignup' => array(
+ 'test_database_schema_up' => 'schema_up.mysql.sql',
+ 'test_database_schema_down' => 'schema_down.sql',
+ ),
'di' => array(
'instance' => array(
'Zend\Db\Adapter\Adapter' => array(
'parameters' => array(
'driver' => array(
'driver' => 'Pdo',
- 'dsn' => 'sqlite::memory:',
+ 'dsn' => "mysql:dbname=travis_test;host=localhost",
+ 'username' => 'root',
+ 'password' => '',
+ 'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
)
),
),
View
33 .travis/module.cdlitwostagesignup.config.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * ZfcUser Configuration
+ *
+ * If you have a ./config/autoload/ directory set up for your project, you can
+ * drop this config file in it and change the values as you wish.
+ */
+$settings = array(
+
+ /**
+ * Email Address that will appear in the 'From' of outbound emails
+ *
+ * Default: empty
+ */
+ 'email_from_address' => 'adamlundrigan@cdli.ca',
+
+ /**
+ * Subject line of the email address verification message which is
+ * sent out when a user enters their email address in Step 1
+ *
+ * Default: 'Email Address Verification'
+ */
+ //'verification_email_subject_line' => 'Email Address Verification',
+
+);
+
+
+/**
+ * You do not need to edit below this line
+ */
+return array(
+ 'cdli-twostagesignup' => $settings,
+);
View
173 .travis/module.zfcuser.config.php
@@ -0,0 +1,173 @@
+<?php
+/**
+ * ZfcUser Configuration
+ *
+ * If you have a ./config/autoload/ directory set up for your project, you can
+ * drop this config file in it and change the values as you wish.
+ */
+$settings = array(
+ /**
+ * Zend\Db\Adapter\Adapter DI Alias
+ *
+ * Please specify the DI alias for the configured Zend\Db\Adapter\Adapter
+ * instance that ZfcUser should use.
+ */
+ 'zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
+
+ /**
+ * User Model Entity Class
+ *
+ * Name of Entity class to use. Useful for using your own entity class
+ * instead of the default one provided. Default is ZfcUser\Model\UserBase.
+ */
+ //'user_model_class' => 'ZfcUser\Model\UserBase',
+
+ /**
+ * Enable registration
+ *
+ * Allows users to register through the website.
+ *
+ * Accepted values: boolean true or false
+ */
+ //'enable_registration' => true,
+
+ /**
+ * UserMeta Model Entity Class
+ *
+ * Name of Entity class to use. Useful for using your own entity class
+ * instead of the default one provided. Default is ZfcUser\Model\UserMetaBase.
+ */
+ //'usermeta_model_class' => 'ZfcUser\Model\UserMetaBase',
+
+ /**
+ * Enable Username
+ *
+ * Enables username field on the registration form, and allows users to log
+ * in using their username OR email address. Default is false.
+ *
+ * Accepted values: boolean true or false
+ */
+ //'enable_username' => false,
+
+ /**
+ * Enable Display Name
+ *
+ * Enables a display name field on the registration form, which is persisted
+ * in the database. Default value is false.
+ *
+ * Accepted values: boolean true or false
+ */
+ //'enable_display_name' => true,
+
+ /**
+ * Require Activation
+ *
+ * Require that the user verify their email address to activate their
+ * account. Default value is false. (Note, this doesn't actually work yet,
+ * but defaults an 'active' field in the DB to 0.)
+ *
+ * Accepted values: boolean true or false
+ */
+ //'require_activation' => false,
+
+ /**
+ * Login After Registration
+ *
+ * Automatically logs the user in after they successfully register. Default
+ * value is false.
+ *
+ * Accepted values: boolean true or false
+ */
+ //'login_after_registration' => true,
+
+ /**
+ * Registration Form Captcha
+ *
+ * Determines if a captcha should be utilized on the user registration form.
+ * Default value is true. (Note, right now this only utilizes a weak
+ * Zend\Text\Figlet CAPTCHA, but I have plans to make all Zend\Captcha
+ * adapters work.)
+ */
+ 'registration_form_captcha' => false,
+
+ /**
+ * Use Redirect Parameter If Present
+ *
+ * Upon successful authentication, check for a 'redirect' POST parameter
+ *
+ * Accepted values: boolean true or false
+ */
+ //'use_redirect_parameter_if_present' => true,
+
+ /**
+ * Password Security
+ *
+ * DO NOT CHANGE THE PASSWORD HASH SETTINGS FROM THEIR DEFAULTS
+ * Unless A) you have done sufficient research and fully understand exactly
+ * what you are changing, AND B) you have a very specific reason to deviate
+ * from the default settings and know what you're doing.
+ *
+ * The password hash settings may be changed at any time without
+ * invalidating existing user accounts. Existing user passwords will be
+ * re-hashed automatically on their next successful login.
+ */
+
+ /**
+ * Password Hash Algorithm
+ *
+ * Name of the hashing algorithm to use for hashing. Supported
+ * algorithms are blowfish, sha512, and sha256. Default is blowfish.
+ *
+ * Accepted values: 'blowfish', 'sha512', and 'sha256'
+ */
+ //'password_hash_algorithm' => 'blowfish',
+
+ /**
+ * Blowfish Cost
+ *
+ * Only used if `password_hash_algorithm` is set to blowfish. The number
+ * represents the base-2 logarithm of the iteration count used for hashing.
+ * Default is 10 (about 10 hashes per second on an i5).
+ *
+ * Accepted values: integer between 4 and 31
+ */
+ //'blowfish_cost' => 10,
+
+ /**
+ * SHA-512 Rounds
+ *
+ * Only used if `password_hash_algorithm` is set to sha512. The number
+ * represents the iteration count used for hashing. Default is 5000.
+ *
+ * Accepted values: integer between 1000 and 999999999
+ */
+ //'sha512_rounds' => 5000,
+
+ /**
+ * SHA-256 Rounds
+ *
+ * Only used if `password_hash_algorithm` is set to sha256. The number
+ * represents the iteration count used for hashing. Default is 5000.
+ *
+ * Accepted values: integer between 1000 and 999999999
+ */
+ //'sha256_rounds' => 5000,
+
+ /**
+ * End of ZfcUser configuration
+ */
+);
+
+/**
+ * You do not need to edit below this line
+ */
+return array(
+ 'zfcuser' => $settings,
+ 'di' => array(
+ 'instance' => array(
+ 'alias' => array(
+ 'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter']: '',
+ ),
+ ),
+ ),
+);
View
2  README.md
@@ -22,7 +22,7 @@ Installation
`application.config.php` file.
2. Clone this project into your `./vendor/` directory and enable it in your
`application.config.php` file.
-3. Import the SQL schema located in `./vendor/CdliTwoStageSignup/data/schema.sql`.
+3. Import the SQL schema located in `./vendor/CdliTwoStageSignup/data/schema_up.mysql.sql`.
4. Copy `./vendor/CdliTwoStageSignup/config/module.cdlitwostagesignup.config.php.dist` to
`./config/autoload/module.cdlitwostagesignup.config.php`.
5. Fill in the required configuration variable values in `./config/autoload/module.cdlitwostagesignup.config.php`
View
24 autoload_classmap.php
@@ -1,15 +1,17 @@
<?php
// Generated by ZF2's ./bin/classmap_generator.php
return array(
- 'CdliTwoStageSignupTest\Model\EmailVerificationTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Model/EmailVerificationTest.php',
- 'CdliTwoStageSignupTest\Model\EmailVerificationMapperTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Model/EmailVerificationMapperTest.php',
- 'CdliTwoStageSignupTest\Framework\TestCase' => __DIR__ . '/tests/CdliTwoStageSignupTest/Framework/TestCase.php',
- 'CdliTwoStageSignupTest\Framework\MapperTestCase' => __DIR__ . '/tests/CdliTwoStageSignupTest/Framework/MapperTestCase.php',
- 'CdliTwoStageSignup\Module' => __DIR__ . '/Module.php',
- 'CdliTwoStageSignup\Controller\RegisterController' => __DIR__ . '/src/CdliTwoStageSignup/Controller/RegisterController.php',
- 'CdliTwoStageSignup\Service\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Service/EmailVerification.php',
- 'CdliTwoStageSignup\Model\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Model/EmailVerification.php',
- 'CdliTwoStageSignup\Model\EmailVerificationMapper' => __DIR__ . '/src/CdliTwoStageSignup/Model/EmailVerificationMapper.php',
- 'CdliTwoStageSignup\Validator\AssertNoValidationInProgress' => __DIR__ . '/src/CdliTwoStageSignup/Validator/AssertNoValidationInProgress.php',
- 'CdliTwoStageSignup\Form\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Form/EmailVerification.php',
+ 'CdliTwoStageSignupTest\Service\EmailVerificationTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Service/EmailVerificationTest.php',
+ 'CdliTwoStageSignupTest\Model\EmailVerificationTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Model/EmailVerificationTest.php',
+ 'CdliTwoStageSignupTest\Model\EmailVerificationMapperTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Model/EmailVerificationMapperTest.php',
+ 'CdliTwoStageSignupTest\Validator\AssertNoValidationInProgressTest' => __DIR__ . '/tests/CdliTwoStageSignupTest/Validator/AssertNoValidationInProgressTest.php',
+ 'CdliTwoStageSignupTest\Framework\TestCase' => __DIR__ . '/tests/CdliTwoStageSignupTest/Framework/TestCase.php',
+ 'CdliTwoStageSignupTest\Framework\MapperTestCase' => __DIR__ . '/tests/CdliTwoStageSignupTest/Framework/MapperTestCase.php',
+ 'CdliTwoStageSignup\Module' => __DIR__ . '/Module.php',
+ 'CdliTwoStageSignup\Controller\RegisterController' => __DIR__ . '/src/CdliTwoStageSignup/Controller/RegisterController.php',
+ 'CdliTwoStageSignup\Service\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Service/EmailVerification.php',
+ 'CdliTwoStageSignup\Model\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Model/EmailVerification.php',
+ 'CdliTwoStageSignup\Model\EmailVerificationMapper' => __DIR__ . '/src/CdliTwoStageSignup/Model/EmailVerificationMapper.php',
+ 'CdliTwoStageSignup\Validator\AssertNoValidationInProgress' => __DIR__ . '/src/CdliTwoStageSignup/Validator/AssertNoValidationInProgress.php',
+ 'CdliTwoStageSignup\Form\EmailVerification' => __DIR__ . '/src/CdliTwoStageSignup/Form/EmailVerification.php',
);
View
1  data/schema_down.sql
@@ -0,0 +1 @@
+DROP TABLE user_signup_email_verification;
View
0  data/schema.sql → data/schema_up.mysql.sql
File renamed without changes
View
0  data/schema.sqlite.sql → data/schema_up.sqlite.sql
File renamed without changes
View
6 tests/CdliTwoStageSignupTest/Framework/MapperTestCase.php
@@ -3,6 +3,7 @@
namespace CdliTwoStageSignupTest\Framework;
use Zend\Db\Adapter\Adapter;
+use CdliTwoStageSignup\Module as modCTSS;
class MapperTestCase extends TestCase
{
@@ -16,13 +17,12 @@ public function setUp()
protected function dbSchemaDown()
{
-# $this->db->query('DROP TABLE IF EXISTS user_signup_email_verification;')->execute();
- $this->db->query('DELETE FROM user_signup_email_verification;')->execute();
+ $this->importSchema(__DIR__ . '/../../../data/' . modCTSS::getOption('test_database_schema_down'));
}
protected function dbSchemaUp()
{
- $this->importSchema(__DIR__ . '/../../../data/schema.sqlite.sql');
+ $this->importSchema(__DIR__ . '/../../../data/' . modCTSS::getOption('test_database_schema_up'));
}
protected function importSchema($file)
Please sign in to comment.
Something went wrong with that request. Please try again.