%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/vendor/cakephp/cakephp/src/TestSuite/Constraint/ |
Upload File : |
<?php
namespace Cake\TestSuite\Constraint;
if (class_exists('PHPUnit_Runner_Version', false)
&& !class_exists('PHPUnit\Framework\Constraint\Constraint', false)
) {
class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint');
}
if (class_exists('PHPUnit_Runner_Version', false)
&& !class_exists('PHPUnit\Framework\AssertionFailedError', false)
) {
class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
}
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Constraint\Constraint;
/**
* EventFired constraint
*/
class EventFired extends Constraint
{
/**
* Array of fired events
*
* @var \Cake\Event\EventManager
*/
protected $_eventManager;
/**
* Constructor
*
* @param \Cake\Event\EventManager $eventManager Event manager to check
*/
public function __construct($eventManager)
{
parent::__construct();
$this->_eventManager = $eventManager;
if ($this->_eventManager->getEventList() === null) {
throw new AssertionFailedError('The event manager you are asserting against is not configured to track events.');
}
}
/**
* Checks if event is in fired array
*
* @param mixed $other Constraint check
* @return bool
*/
public function matches($other)
{
return $this->_eventManager->getEventList()->hasEvent($other);
}
/**
* Assertion message string
*
* @return string
*/
public function toString()
{
return 'was fired';
}
}