Closed jubianchi closed 7 years ago
Good! Warning, just see that unique ID in mock seems to be in 2.9.0. And just to be sure… can you confirm that mock generator now handle type hinting on return value?
@mageekguy yes it does ;)
<?php
declare(strict_types=1);
namespace
{
class foo
{
public function bar() : int
{
return rand(0, PHP_INT_MAX);
}
}
}
namespace tests\units
{
use atoum;
class foo extends atoum
{
public function testBar(\foo $foo)
{
$this
->integer($foo->bar())
->isGreaterThanOrEqualTo(0)
->isLessThanOrEqualTo(PHP_INT_MAX)
->if($this->calling($foo)->bar = '42')
->then
->integer($foo->bar())->isIdenticalTo(42)
;
}
}
}
$ bin/atoum -f test.php
> atoum path: /Users/julien.bianchi/repositories/atoum/atoum/bin/atoum
> atoum version: dev-master
> PHP path: /usr/local/Cellar/php71/7.1.1_12/bin/php
> PHP version:
=> PHP 7.1.1 (cli) (built: Jan 21 2017 13:36:56) ( NTS )
=> Copyright (c) 1997-2017 The PHP Group
=> Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
> tests\units\foo...
[S___________________________________________________________][1/1]
=> Test duration: 0.01 second.
=> Memory usage: 0.00 Mb.
> Total test duration: 0.01 second.
> Total test memory usage: 0.00 Mb.
> Running duration: 0.04 second.
Success (1 test, 1/1 method, 0 void method, 0 skipped method, 5 assertions)!
@mageekguy
totally right: I wanted to put the "Assertions" part at the beginning but forgot to move sections.
Totally right! will add it :)
We already ran through a beta without tagging it: the branch alias
3.x-dev
has been available for a long time and we had some feedback. The release was ready some weeks ago but we got feedback and we had to fix new issues ;)