Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Test to prove that this solution does not work yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansoweb committed Oct 5, 2012
1 parent a90b738 commit bcc912b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ZendTest/EventManager/StaticEventManagerTest.php
Expand Up @@ -254,6 +254,26 @@ public function testListenersAttachedToAnyIdentifierProvidedToEventManagerWillBe
$this->assertEquals(2, $test->triggered);
}

public function testListenersAttachedToWildcardsWillBeTriggered()
{
$identifiers = array('foo', 'bar');
$events = StaticEventManager::getInstance();
$manager = new EventManager($identifiers);
$manager->setSharedManager($events);

$test = new \stdClass;
$test->triggered = 0;
$events->attach('*', 'bar', function($e) use ($test) {
$test->triggered++;
});
//Tests one can have multiple wildcards attached
$events->attach('*', 'bar', function($e) use ($test) {
$test->triggered++;
});
$manager->trigger('bar', $this, array());
$this->assertEquals(2, $test->triggered);
}

public function testListenersAttachedToAnyIdentifierProvidedToEventManagerOrWildcardsWillBeTriggered()
{
$identifiers = array('foo', 'bar');
Expand Down

0 comments on commit bcc912b

Please sign in to comment.