Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
bb77189f
Commit
bb77189f
authored
Oct 11, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up arr tests.
parent
b3c9dc59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ArrTest.php
tests/Cases/ArrTest.php
+5
-5
No files found.
tests/Cases/ArrTest.php
View file @
bb77189f
...
...
@@ -5,7 +5,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider getArray
*/
public
function
test
GetMethodReturnsItemsFromA
rray
(
$array
)
public
function
test
_get_method_returns_item_from_a
rray
(
$array
)
{
$this
->
assertEquals
(
Arr
::
get
(
$array
,
'email'
),
$array
[
'email'
]);
$this
->
assertEquals
(
Arr
::
get
(
$array
,
'names.uncle'
),
$array
[
'names'
][
'uncle'
]);
...
...
@@ -14,7 +14,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider getArray
*/
public
function
test
GetMethodReturnsDefaultWhenItemDoesntE
xist
(
$array
)
public
function
test
_get_method_returns_default_when_item_doesnt_e
xist
(
$array
)
{
$this
->
assertNull
(
Arr
::
get
(
$array
,
'names.aunt'
));
$this
->
assertEquals
(
Arr
::
get
(
$array
,
'names.aunt'
,
'Tammy'
),
'Tammy'
);
...
...
@@ -24,7 +24,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider getArray
*/
public
function
test
SetMethodSetsItemsInA
rray
(
$array
)
public
function
test
_set_method_sets_items_in_a
rray
(
$array
)
{
Arr
::
set
(
$array
,
'name'
,
'Taylor'
);
Arr
::
set
(
$array
,
'names.aunt'
,
'Tammy'
);
...
...
@@ -37,7 +37,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider getArray
*/
public
function
test
FirstMethodReturnsFirstItemPassingTruthT
est
(
$array
)
public
function
test
_first_method_returns_first_item_passing_truth_t
est
(
$array
)
{
$array
[
'email2'
]
=
'taylor@hotmail.com'
;
$this
->
assertEquals
(
'taylorotwell@gmail.com'
,
Arr
::
first
(
$array
,
function
(
$k
,
$v
)
{
return
substr
(
$v
,
0
,
3
)
==
'tay'
;}));
...
...
@@ -46,7 +46,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider getArray
*/
public
function
test
FirstMethodReturnsDefaultWhenNoItemExists
(
$array
)
public
function
test
_first_method_returns_default_when_no_matching_item_is_found
(
$array
)
{
$this
->
assertNull
(
Arr
::
first
(
$array
,
function
(
$k
,
$v
)
{
return
$v
===
'something'
;}));
$this
->
assertEquals
(
'default'
,
Arr
::
first
(
$array
,
function
(
$k
,
$v
)
{
return
$v
===
'something'
;},
'default'
));
...
...
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