Welcome Guest, Not a member yet? Register   Sign In
PHPUnit and extended class
#1

Hello, I am testing PHPunit with CI4.

I run a test on HTTP testing (to test routes), so my classe extends "FeatureTestCase"

And when I run my test, PHPUNIT says : 

Code:
1) Warning

No tests found in class "CodeIgniter\Test\FeatureTestCase".



This is my test class :
PHP Code:
<?php

namespace App;

use 
CodeIgniter\Test\FeatureTestCase;

class 
TestUrlExists extends FeatureTestCase
{
    public function setUp(): void
    
{
        parent::setUp();
    }

    public function tearDown(): void
    
{
        parent::tearDown();
    }

    public function testHome(){
        
        $result 
$this->call('get''/');        
        $this
->assertTrue($result->isOK());

    }

    public function testContact(){        
        $result 
$this->call('get''/contact');        
        $this
->assertTrue($result->isOK());
    }




I just want to "exclude" the parent class from the code coverage, but I search everywhere, I didn't find. I think it's more touchy because it's not a file but a namespace...

Please, how can I exclude the framework's class from my test ?

Thanks
Reply


Messages In This Thread
PHPUnit and extended class - by WebboyFR - 03-17-2021, 11:30 AM
RE: PHPUnit and extended class - by kenjis - 03-17-2021, 03:52 PM
RE: PHPUnit and extended class - by WebboyFR - 03-18-2021, 01:32 AM
RE: PHPUnit and extended class - by WebboyFR - 03-18-2021, 01:55 AM
RE: PHPUnit and extended class - by kenjis - 03-18-2021, 10:26 PM
RE: PHPUnit and extended class - by WebboyFR - 03-19-2021, 02:06 AM
RE: PHPUnit and extended class - by kenjis - 03-19-2021, 02:20 AM
RE: PHPUnit and extended class - by WebboyFR - 03-19-2021, 02:29 AM
RE: PHPUnit and extended class - by kenjis - 03-19-2021, 03:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB