My Phpunit tests returns risky_tests

Posted 4 years ago by sandeepseshadri

When i run my test i get the following risky nessage

PHPUnit 4.7.5 by Sebastian Bergmann and contributors.

....................R

Time: 1.48 seconds, Memory: 16.25Mb

OK, but incomplete, skipped, or risky tests!
Tests: 21, Assertions: 19, Risky: 1.

The unit test for wihch i am getting the error

  public function testFetchReportSuccess()
    {
        $content = 'Response =  <creditBureau>code</creditBureau>';
        $expected = '<creditBureau>code</creditBureau>';

        Config::shouldReceive('get')->andReturn('/tmp/contacts');
        File::shouldReceive('get')->once()->andReturn((string)$content);
        File::shouldReceive('exists')->once()->andReturn(true);

        $this->target->shouldReceive( 'fetch' )->once()->passthru();
        $response = $this->target->fetch(9054);
        $this->assertContains( $response, $expected);

    }

i am able to pinpoint my error to the $content variable if i escape the > in the string i dont get the error.

does anyone know why i am getting this error.

Please sign in or create an account to participate in this conversation.