AssetBuilderTest - Add more assertions for Guzzle variant of test
authorTim Otten <totten@civicrm.org>
Thu, 6 Jun 2019 09:34:50 +0000 (02:34 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 6 Jun 2019 09:34:50 +0000 (02:34 -0700)
tests/phpunit/E2E/Core/AssetBuilderTest.php

index 4e5e0bac0caee94fb1ff2488f0481a7fbd90a773..03c8d67bd4057f5c700d3d89fc92268775828a6b 100644 (file)
@@ -165,10 +165,12 @@ class AssetBuilderTest extends \CiviEndToEndTestCase {
     try {
       $guzzleClient = new \GuzzleHttp\Client();
       $guzzleResponse = $guzzleClient->request('GET', $url, array('timeout' => 1));
+      $this->fail('Expecting ClientException... but it was not thrown!');
     }
     catch (\GuzzleHttp\Exception\ClientException $e) {
       $this->assertNotEmpty(preg_match(';404;', $e->getMessage()),
         'Expect to find HTTP 404. Found: ' . json_encode(preg_match(';^HTTP;', $e->getMessage())));
+      $this->assertEquals('Unrecognized asset name: invalid.json', $e->getResponse()->getBody());
     }
   }