Fix undefined properties in models [MAILPOET-2488]
This commit is contained in:
@ -6,6 +6,7 @@ use MailPoet\Form\Block\Date;
|
|||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @property string $name
|
||||||
* @property string $type
|
* @property string $type
|
||||||
* @property string|array|null $params
|
* @property string|array|null $params
|
||||||
*/
|
*/
|
||||||
|
@ -123,6 +123,8 @@ use MailPoet\WP\Functions as WPFunctions;
|
|||||||
* @property string|null $created_at
|
* @property string|null $created_at
|
||||||
* @property string|null $updated_at
|
* @property string|null $updated_at
|
||||||
* @property string|null $id
|
* @property string|null $id
|
||||||
|
* @property string|null $first
|
||||||
|
* @property string|null $last
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Model extends \MailPoetVendor\Sudzy\ValidModel {
|
class Model extends \MailPoetVendor\Sudzy\ValidModel {
|
||||||
|
@ -20,6 +20,7 @@ use function MailPoetVendor\array_column;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @property int $id
|
* @property int $id
|
||||||
|
* @property int $parent_id
|
||||||
* @property string $type
|
* @property string $type
|
||||||
* @property object|array|boolean $queue
|
* @property object|array|boolean $queue
|
||||||
* @property string $hash
|
* @property string $hash
|
||||||
@ -29,11 +30,13 @@ use function MailPoetVendor\array_column;
|
|||||||
* @property array $options
|
* @property array $options
|
||||||
* @property int $children_count
|
* @property int $children_count
|
||||||
* @property bool|array $statistics
|
* @property bool|array $statistics
|
||||||
|
* @property string $sent_at
|
||||||
* @property string $deleted_at
|
* @property string $deleted_at
|
||||||
* @property int $total_sent
|
* @property int $total_sent
|
||||||
* @property int $total_scheduled
|
* @property int $total_scheduled
|
||||||
* @property array $segments
|
* @property array $segments
|
||||||
* @property string $subject
|
* @property string $subject
|
||||||
|
* @property string $preheader
|
||||||
* @property string $body
|
* @property string $body
|
||||||
* @property string|null $schedule
|
* @property string|null $schedule
|
||||||
* @property boolean|null $isScheduled
|
* @property boolean|null $isScheduled
|
||||||
|
@ -4,6 +4,11 @@ namespace MailPoet\Models;
|
|||||||
|
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $name
|
||||||
|
* @property string $newsletter_type
|
||||||
|
*/
|
||||||
|
|
||||||
class NewsletterOptionField extends Model {
|
class NewsletterOptionField extends Model {
|
||||||
public static $_table = MP_NEWSLETTER_OPTION_FIELDS_TABLE;
|
public static $_table = MP_NEWSLETTER_OPTION_FIELDS_TABLE;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ use MailPoet\WP\Functions as WPFunctions;
|
|||||||
* @property string|array $subscribers
|
* @property string|array $subscribers
|
||||||
* @property string|null $deleted_at
|
* @property string|null $deleted_at
|
||||||
* @property string $scheduled_at
|
* @property string $scheduled_at
|
||||||
|
* @property string $status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SendingQueue extends Model {
|
class SendingQueue extends Model {
|
||||||
|
@ -16,6 +16,9 @@ use function MailPoetVendor\array_column;
|
|||||||
* @property int $task_id
|
* @property int $task_id
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $newsletter_id
|
* @property int $newsletter_id
|
||||||
|
* @property string $newsletter_rendered_subject
|
||||||
|
* @property string $newsletter_rendered_body
|
||||||
|
* @property bool $non_existent_column
|
||||||
*/
|
*/
|
||||||
class Sending {
|
class Sending {
|
||||||
const TASK_TYPE = 'sending';
|
const TASK_TYPE = 'sending';
|
||||||
|
@ -514,7 +514,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'processWelcomeNewsletter' => Expected::exactly(1),
|
'processWelcomeNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +526,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'processPostNotificationNewsletter' => Expected::exactly(1),
|
'processPostNotificationNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,7 +538,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'processScheduledStandardNewsletter' => Expected::exactly(1),
|
'processScheduledStandardNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +566,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is not processed
|
// scheduled job is not processed
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +580,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is processed
|
// scheduled job is processed
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,7 +626,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'cron_helper' => $this->cron_helper,
|
'cron_helper' => $this->cron_helper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is processed
|
// scheduled job is processed
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,7 +716,6 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
$queue->updated_at = $originalUpdated;
|
$queue->updated_at = $originalUpdated;
|
||||||
$queue->save();
|
$queue->save();
|
||||||
$scheduler = new Scheduler($this->makeEmpty(SubscribersFinder::class), $this->logger_factory, $this->cron_helper);
|
$scheduler = new Scheduler($this->makeEmpty(SubscribersFinder::class), $this->logger_factory, $this->cron_helper);
|
||||||
$scheduler->timer = microtime(true);
|
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
$newQueue = ScheduledTask::findOne($queue->task_id);
|
$newQueue = ScheduledTask::findOne($queue->task_id);
|
||||||
expect($newQueue->updated_at)->notEquals($originalUpdated);
|
expect($newQueue->updated_at)->notEquals($originalUpdated);
|
||||||
|
@ -129,7 +129,7 @@ class MigrationTest extends \MailPoetTest {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$next_run_date = $this->worker->getNextRunDate($wp);
|
$next_run_date = $this->worker->getNextRunDate($wp);
|
||||||
expect($next_run_date->timestamp)->equals($timestamp);
|
expect($next_run_date->getTimestamp())->equals($timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createScheduledTask() {
|
private function createScheduledTask() {
|
||||||
|
Reference in New Issue
Block a user