CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.5 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.5
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Middleware
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
      • Session
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Constraint
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • EventFired
  • EventFiredWith
 1: <?php
 2: namespace Cake\TestSuite\Constraint;
 3: 
 4: if (class_exists('PHPUnit_Runner_Version', false)
 5:     && !class_exists('PHPUnit\Framework\Constraint\Constraint', false)
 6: ) {
 7:     class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint');
 8: }
 9: if (class_exists('PHPUnit_Runner_Version', false)
10:     && !class_exists('PHPUnit\Framework\AssertionFailedError', false)
11: ) {
12:     class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
13: }
14: 
15: use PHPUnit\Framework\AssertionFailedError;
16: use PHPUnit\Framework\Constraint\Constraint;
17: 
18: /**
19:  * EventFired constraint
20:  */
21: class EventFired extends Constraint
22: {
23:     /**
24:      * Array of fired events
25:      *
26:      * @var \Cake\Event\EventManager
27:      */
28:     protected $_eventManager;
29: 
30:     /**
31:      * Constructor
32:      *
33:      * @param \Cake\Event\EventManager $eventManager Event manager to check
34:      */
35:     public function __construct($eventManager)
36:     {
37:         parent::__construct();
38:         $this->_eventManager = $eventManager;
39: 
40:         if ($this->_eventManager->getEventList() === null) {
41:             throw new AssertionFailedError('The event manager you are asserting against is not configured to track events.');
42:         }
43:     }
44: 
45:     /**
46:      * Checks if event is in fired array
47:      *
48:      * @param mixed $other Constraint check
49:      * @return bool
50:      */
51:     public function matches($other)
52:     {
53:         return $this->_eventManager->getEventList()->hasEvent($other);
54:     }
55: 
56:     /**
57:      * Assertion message string
58:      *
59:      * @return string
60:      */
61:     public function toString()
62:     {
63:         return 'was fired';
64:     }
65: }
66: 
Follow @CakePHP
#IRC
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs