-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bc566c2
Showing
32 changed files
with
1,750 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# atoum stubs | ||
|
||
![atoum](http://downloads.atoum.org/images/logo.png) | ||
|
||
## Install it | ||
|
||
Install extension using [composer](https://getcomposer.org): | ||
|
||
```json | ||
{ | ||
"require-dev": { | ||
"atoum/stubs": "*" | ||
} | ||
} | ||
``` | ||
|
||
## Use it | ||
|
||
Once your IDE is correctly configured, the only thing you will have to do is use atoum | ||
through one of its alias: | ||
|
||
```php | ||
<?php | ||
|
||
// tests/units/random.php | ||
|
||
namespace tests\units; | ||
|
||
use atoum; // or mageekguy\atoum | ||
|
||
class random extends atoum { | ||
// ... | ||
} | ||
``` | ||
|
||
atoum provides 3 aliases for the main test class, choose the one you prefer: | ||
|
||
* `atoum` | ||
* `atoum\test` | ||
* `mageekguy\atoum` | ||
|
||
|
||
Once done, you will get full featured code-completion: | ||
|
||
![atoum-stubs](demo.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
class atoum extends atoum\test {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace atoum; | ||
|
||
use mageekguy; | ||
|
||
class test extends mageekguy\atoum | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
<?php | ||
|
||
namespace mageekguy; | ||
|
||
use | ||
mageekguy, | ||
mageekguy\atoum\stubs, | ||
mageekguy\atoum\stubs\asserters, | ||
mageekguy\atoum\test, | ||
mageekguy\atoum\php, | ||
mageekguy\atoum\mock | ||
; | ||
|
||
/** | ||
* @method $this and(...$mixed) | ||
* @method $this as($alias) | ||
* @method $this if(...$mixed) | ||
* @method $this use($target) | ||
*/ | ||
class atoum extends mageekguy\atoum\test | ||
{ | ||
use stubs\asserters | ||
|
||
/** | ||
* @var static | ||
*/ | ||
public $and; | ||
|
||
/** | ||
* @var static | ||
*/ | ||
public $assert; | ||
|
||
/** | ||
* @var test\assertion\aliaser | ||
*/ | ||
public $define; | ||
|
||
/** | ||
* @var \exception | ||
*/ | ||
public $exception; | ||
|
||
/** | ||
* @var php\mocker | ||
*/ | ||
public $function; | ||
|
||
/** | ||
* @var static | ||
*/ | ||
public $given; | ||
|
||
/** | ||
* @var static | ||
*/ | ||
public $if; | ||
|
||
/** | ||
* @var object | ||
*/ | ||
public $newInstance; | ||
|
||
/** | ||
* @var object | ||
*/ | ||
public $newTestedInstance; | ||
|
||
/** | ||
* @var asserters\testedClass | ||
*/ | ||
public $testedClass; | ||
|
||
/** | ||
* @var object | ||
*/ | ||
public $testedInstance; | ||
|
||
/** | ||
* @var static | ||
*/ | ||
public $then; | ||
|
||
/** | ||
* @param mock\aggregator $mock | ||
* | ||
* @return mock\controller | ||
*/ | ||
public function ƒ(mock\aggregator $mock) {} | ||
|
||
/** | ||
* @param string $case | ||
* | ||
* @return $this | ||
*/ | ||
public function assert($case = null) {} | ||
|
||
/** | ||
* @param mock\aggregator $mock | ||
* | ||
* @return mock\controller | ||
*/ | ||
public function calling(mock\aggregator $mock) {} | ||
|
||
/** | ||
* @param mixed ...$mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function define(...$mixed) {} | ||
|
||
/** | ||
* @param ...$mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function dump(...$mixed) {} | ||
|
||
/** | ||
* @param mixed $mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function dumpOnFailure($mixed) {} | ||
|
||
/** | ||
* @param \closure $callback | ||
* | ||
* @return $this | ||
*/ | ||
public function executeOnFailure(\closure $callback) {} | ||
|
||
/** | ||
* @param string $class | ||
* | ||
* @return $this | ||
*/ | ||
public function from($class) {} | ||
|
||
/** | ||
* @param mixed ...$mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function given(...$mixed) {} | ||
|
||
/** | ||
* @param mixed ...$mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function let(...$mixed) {} | ||
|
||
/** | ||
* @param string $class | ||
* @param string $mockNamespace | ||
* @param string $mockClass | ||
* | ||
* @return $this | ||
*/ | ||
public function mockClass($class, $mockNamespace = null, $mockClass = null) {} | ||
|
||
/** | ||
* @param mixed ...$mixed | ||
* | ||
* @return mock\generator | ||
*/ | ||
public function mockGenerator() {} | ||
|
||
/** | ||
* @param string $mockNamespace | ||
* @param string $mockClass | ||
* | ||
* @return $this | ||
*/ | ||
public function mockTestedClass($mockNamespace = null, $mockClass = null) {} | ||
|
||
/** | ||
* @param mixed ...$arguments | ||
* | ||
* @return object | ||
*/ | ||
public function newTestedInstance(...$arguments) {} | ||
|
||
/** | ||
* @param mixed ...$arguments | ||
* | ||
* @return object | ||
*/ | ||
public function newInstance(...$arguments) {} | ||
|
||
/** | ||
* @throws test\exceptions\stop | ||
* | ||
* @return $this | ||
*/ | ||
public function stop() {} | ||
|
||
/** | ||
* @param mixed ...$mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function then(...$mixed) {} | ||
|
||
/** | ||
* @param \closure|mixed $mixed | ||
* | ||
* @return $this | ||
*/ | ||
public function when($mixed) {} | ||
|
||
|
||
/** | ||
* @param test\adapter $adapter | ||
* | ||
* @return asserters\adapter | ||
*/ | ||
public function adapter(test\adapter $adapter) {} | ||
} |
Oops, something went wrong.