Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 236ed93

Browse files
committed
Add test alias for it
Signed-off-by: RJ Garcia <[email protected]>
1 parent e785c17 commit 236ed93

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/Dsl.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ function it($description, callable $fn = null)
3434
Context::getInstance()->addTest($description, $fn);
3535
}
3636

37+
/**
38+
* Identical to it. Useful for test readability
39+
*
40+
* @param $description
41+
* @param $fn
42+
*/
43+
function test($description, callable $fn = null)
44+
{
45+
it($description, $fn);
46+
}
47+
3748
/**
3849
* Create a pending suite
3950
*
@@ -67,6 +78,17 @@ function xit($description, callable $fn = null)
6778
Context::getInstance()->addTest($description, $fn, true);
6879
}
6980

81+
/**
82+
* Create a pending spec
83+
*
84+
* @param $description
85+
* @param callable $fn
86+
*/
87+
function xtest($description, callable $fn = null)
88+
{
89+
xit($description, $fn);
90+
}
91+
7092
/**
7193
* Create a focused suite
7294
*
@@ -100,6 +122,17 @@ function fit($description, callable $fn = null)
100122
Context::getInstance()->addTest($description, $fn, null, true);
101123
}
102124

125+
/**
126+
* Create a focused spec
127+
*
128+
* @param $description
129+
* @param callable $fn
130+
*/
131+
function ftest($description, callable $fn = null)
132+
{
133+
fit($description, $fn);
134+
}
135+
103136
/**
104137
* Add a setup function for all specs in the
105138
* current suite

0 commit comments

Comments
 (0)