Skip to content

Commit

Permalink
Merge pull request #14 from k1LoW/update-schema-form_name-from_email
Browse files Browse the repository at this point in the history
Update schema for TEST-GREEN
  • Loading branch information
lorenzo committed Apr 27, 2016
2 parents fa0c875 + f2f18af commit bcd5e85
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/Migrations/20160324054602_Initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public function up()
->addColumn('from_name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
'null' => true,
])
->addColumn('from_email', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
'null' => true,
])
->addColumn('subject', 'string', [
'default' => null,
Expand Down
4 changes: 2 additions & 2 deletions config/Schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ DROP TABLE IF EXISTS `email_queue`;
CREATE TABLE IF NOT EXISTS `email_queue` (
`id` char(36) CHARACTER SET ascii NOT NULL,
`email` varchar(129) NOT NULL,
`from_name` varchar(255) NOT NULL,
`from_email` varchar(255) NOT NULL,
`from_name` varchar(255),
`from_email` varchar(255),
`subject` varchar(255) NOT NULL,
`config` varchar(30) NOT NULL,
`template` varchar(50) NOT NULL,
Expand Down
14 changes: 14 additions & 0 deletions tests/Fixture/EmailQueueFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class EmailQueueFixture extends TestFixture
public $fields = array(
'id' => array('type' => 'uuid', 'null' => false),
'email' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'from_name' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 100, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'from_email' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 100, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'subject' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 255, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'config' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'template' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
Expand All @@ -44,6 +46,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-1',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand All @@ -61,6 +65,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-2',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand All @@ -78,6 +84,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-3',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand All @@ -95,6 +103,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-4',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand All @@ -112,6 +122,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-5',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand All @@ -129,6 +141,8 @@ class EmailQueueFixture extends TestFixture
array(
'id' => 'email-6',
'email' => '[email protected]',
'from_name' => null,
'from_email' => null,
'subject' => 'Free dealz',
'config' => 'default',
'template' => 'default',
Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase/Model/Table/EmailQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ public function testEnqueue()
'template_vars' => array('a' => 'variable', 'some' => 'thing'),
'sent' => false,
'locked' => false,
'send_tries' => '0',
'send_tries' => 0,
'config' => 'default',
'headers' => array('X-FOO' => 'bar', 'X-BAZ' => 'thing'),
'from_name' => null,
'from_email' => null
);
$sendAt = new Time($result['send_at']);
unset($result['id'], $result['created'], $result['modified'], $result['send_at']);
Expand Down

0 comments on commit bcd5e85

Please sign in to comment.