PHP code example of appeltaert / phpunit-assertion-message

1. Go to this page and download the library: Download appeltaert/phpunit-assertion-message library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

appeltaert / phpunit-assertion-message example snippets


$client->enableProfiler();
$response = $client->getResponse();

$this->assertTrue($response->isSuccessful(), "My message");

$client->enableProfiler();
$response = $client->getResponse();

$this->assertTrue($response->isSuccessful(), 
    new PAM("My message", [$response, $profiler->getCollector('request')]));

$response = $client->getResponse();
$this->assertTrue($response->isSuccessful(), new PAM("My message", [$response]));

$this->assertSame(
    Response::HTTP_OK,
    $client->getResponse()->getStatusCode(),
    new PAM(sprintf('The %s public URL loads correctly.', $url), [$client->getProfile()->getCollector('request')])
);

$someArray = [];
$this->assertArrayHasKey("test", $array, new PAM("My message", [
    'qwerqwer' => 'qwerqewr', ['qwerqewr', 'qwerqwer']
]));

PAM::setDefaults($processors, $printer, $env);

There was 1 failure:
    
1) Tests\AppBundle\Controller\DefaultControllerTest::testIndex
My message

// wtf is going on
// $this->assertTrue($client->getResponse()->isSuccessful())
// $collector = $profiler->getCollector()..
// var_dump($collector->...);
// echo $response->getContent();
// var_dump($response->headers->all();
// die.. die.. die..