Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
8325f6dc
Commit
8325f6dc
authored
Jan 27, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added event class tests.
parent
e7d3929a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
tests/cases/laravel/event.test.php
+51
-0
No files found.
tests/cases/laravel/event.test.php
0 → 100644
View file @
8325f6dc
<?php
class
EventTest
extends
PHPUnit_Framework_TestCase
{
/**
* Tear down the testing environment.
*/
public
function
tearDown
()
{
Event
::
$events
=
array
();
}
/**
* Test basic event firing.
*
* @group laravel
*/
public
function
testListenersAreFiredForEvents
()
{
Event
::
listen
(
'test.event'
,
function
()
{
return
1
;
});
Event
::
listen
(
'test.event'
,
function
()
{
return
2
;
});
$responses
=
Event
::
fire
(
'test.event'
);
$this
->
assertEquals
(
1
,
$responses
[
0
]);
$this
->
assertEquals
(
2
,
$responses
[
1
]);
}
/**
* Test parameters can be passed to event listeners.
*
* @group laravel
*/
public
function
testParametersCanBePassedToEvents
()
{
Event
::
listen
(
'test.event'
,
function
(
$var
)
{
return
$var
;
});
$responses
=
Event
::
fire
(
'test.event'
,
array
(
'Taylor'
));
$this
->
assertEquals
(
'Taylor'
,
$responses
[
0
]);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment