Fix test for Migrator.

This commit is contained in:
marco
2015-08-07 22:14:43 +02:00
parent e2e5f94304
commit a6bc4f5d18
3 changed files with 4 additions and 4 deletions

View File

@@ -225,7 +225,7 @@ class Initializer {
} }
public function admin_page() { public function admin_page() {
$subscriber = new Models\Subscriber(); /* $subscriber = new Models\Subscriber(); */
$option = new WP\Option(); $option = new WP\Option();
$option->set('option_name', 'option value'); $option->set('option_name', 'option value');
@@ -239,7 +239,7 @@ class Initializer {
array('name' => 'Joo', 'email' => 'jonathan@mailpoet.com'), array('name' => 'Joo', 'email' => 'jonathan@mailpoet.com'),
array('name' => 'Marco', 'email' => 'marco@mailpoet.com'), array('name' => 'Marco', 'email' => 'marco@mailpoet.com'),
), ),
'subscriber' => $subscriber->name, /* 'subscriber' => $subscriber->name, */
'option' => $option->get('option_name') 'option' => $option->get('option_name')
); );
// Sample page using Twig // Sample page using Twig

View File

@@ -43,7 +43,7 @@ class Migrator {
'first_name tinytext NOT NULL,', 'first_name tinytext NOT NULL,',
'last_name tinytext NOT NULL,', 'last_name tinytext NOT NULL,',
'email tinytext NOT NULL,', 'email tinytext NOT NULL,',
'PRIMARY KEY (id)' 'PRIMARY KEY (id)',
); );
return $this->sqlify(__FUNCTION__, $attributes); return $this->sqlify(__FUNCTION__, $attributes);
} }

View File

@@ -7,7 +7,7 @@ class MigratorCest {
$this->migrator = new Migrator(); $this->migrator = new Migrator();
} }
function itCanGenerateTheSubscriberSql() { function itCanGenerateTheSubscribersSql() {
$subscriber_sql = $this->migrator->subscribers(); $subscriber_sql = $this->migrator->subscribers();
$expected_table = $this->migrator->prefix . 'subscribers'; $expected_table = $this->migrator->prefix . 'subscribers';
expect($subscriber_sql)->contains($expected_table); expect($subscriber_sql)->contains($expected_table);