Test Failed
Pull Request — develop (#20)
by Denis
11:40 queued 03:37
created

testSearchProductsActionSuccess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Tests\Functional;
4
5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6
7
class ArtprimaPrometheusBundleTest extends WebTestCase
8
{
9
    public function testSearchProductsActionSuccess()
10
    {
11
        $client = static::createClient();
12
13
        $client->request('GET', '/metrics/prometheus');
14
        self::assertResponseIsSuccessful();
15
        $content = $client->getResponse()->getContent();
16
        $expected = "# HELP php_info Information about the PHP environment.\n# TYPE php_info gauge\nphp_info{version=\"%s\"} 1";
17
        self::assertContains(
18
            sprintf($expected, PHP_VERSION),
19
            trim($content)
0 ignored issues
show
Bug introduced by
trim($content) of type string is incompatible with the type iterable expected by parameter $haystack of PHPUnit\Framework\Assert::assertContains(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
            /** @scrutinizer ignore-type */ trim($content)
Loading history...
20
        );
21
    }
22
}