atoum / atoum.github.io

Atoum website
http://atoum.github.io
2 stars 8 forks source link

Add the blog post about the 3.0.0 release #61

Closed jubianchi closed 7 years ago

jubianchi commented 7 years ago

@mageekguy

I think that the the move towards PSR-2 is the first "big thing" is not a good idea

totally right: I wanted to put the "Assertions" part at the beginning but forgot to move sections.

Moreover, at least a new feature, aka unique ID in mock, is missing.

Totally right! will add it :)

And… it's a BC version… so maybe you may do a beta version and collect end user feedback to avoid a PHPUnit 6.0 effect.

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 ;)

mageekguy commented 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?

jubianchi commented 7 years ago

@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)!