Only send component change email when the status changes. Fixes #1989

This commit is contained in:
James Brooks
2016-08-07 22:50:51 +01:00
parent c27d59aadf
commit e281c5d646
5 changed files with 105 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Tests\Cachet\Bus\Events\Component;
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
use CachetHQ\Cachet\Models\Component;
/**
* This is the component status was updated event test.
*
* @author James Brooks <james@alt-three.com>
*/
class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
{
protected function objectHasHandlers()
{
return true;
}
protected function getObjectAndParams()
{
$params = ['component' => new Component(), 'original_status' => 1, 'new_status' => 1];
$object = new ComponentStatusWasUpdatedEvent($params['component'], $params['original_status'], $params['new_status']);
return compact('params', 'object');
}
}