atoum / AtoumBundle

This bundle provides a simple integration of atoum into Symfony 2.
MIT License
44 stars 25 forks source link

No assert in WebTestCase #86

Closed ekitakata closed 9 years ago

ekitakata commented 9 years ago

Hi,

I make a simple test class who extends WebTestCase

namespace COmpany\TotoBundle\Tests\Units\Controller;

use atoum\AtoumBundle\Test\Units\WebTestCase;

class AuthenticationController extends WebTestCase
{

    public function testLogoutAction()
    {
        $this->request()
                ->GET('/logout')
                    ->hasStatus(302)
                    ->hasCharset('UTF-8')
                ->GET('/logout/')
                    ->hasStatus(404)
        ;
    }
}

When i play this test, test pass but the result is

Success (1 test, 0/1 method, 1 void method, 0 skipped method, 0 assertion)!

0 assertion : it's normal or due to my environment ?

environment : PHP 5.6.11-1+deb.sury.org~trusty+1 (cli) => Copyright (c) 1997-2015 The PHP Group => Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies => with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies => with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans

Thanks in advance

jubianchi commented 9 years ago

0 assertion : it's normal or due to my environment ?

I think this is a bug, but the assertion are actually run. If you want to be sure, try forcing one to fail by changing ->hasStatus(302) to ->hasStatus(400) for example ;)

ekitakata commented 9 years ago

yes it run and fail with "success"

i've test in other environment (php 5.5.9) and same results test fail good but pass with 0 assertions.

So it seem's little non blocking bug.

Tom32i commented 9 years ago

Same problem here.

fabdsp commented 9 years ago

:+1:

ektarum commented 9 years ago

bump @jubianchi

jubianchi commented 9 years ago

should we close this now that the #87 is merged ?

FlorianLB commented 9 years ago

Yep