Skip to content

[Backport] Filter test result collection with the cron job code defined in the c… #17192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ protected function setUp()
}

/**
* @magentoConfigFixture current_store crontab/default/jobs/catalog_product_alert/schedule/cron_expr 8 * * * *
* @magentoConfigFixture current_store crontab/default/jobs/catalog_product_alert/schedule/cron_expr * * * * *
*/
public function testDispatchScheduled()
{
$collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
'Magento\Cron\Model\ResourceModel\Schedule\Collection'
);
$collection->addFieldToFilter('status', \Magento\Cron\Model\Schedule::STATUS_PENDING);
$collection->addFieldToFilter('job_code', 'catalog_product_alert');
$this->assertGreaterThan(0, $collection->count(), 'Cron has failed to schedule tasks for itself for future.');
}

Expand Down