Skip to content

Commit

Permalink
Revert "more integration tests for fatal error"
Browse files Browse the repository at this point in the history
This reverts commit de804e1.
  • Loading branch information
samsonasik committed Sep 20, 2018
1 parent d7d4b0b commit eb05207
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,4 @@
});
});

describe('/error-preview/fatal', function() {

it('show error page', function() {

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');
expect($this->application->getResponse()->getStatusCode())->toBe(500);

});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,4 @@
});
});

describe('/error-preview/fatal', function() {

it('show error page', function() {

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');
expect($this->application->getResponse()->getStatusCode())->toBe(500);

});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -146,55 +146,4 @@

});

describe('/error-preview/fatal', function() {

it('show error page', function() {

$this->tableGateway->delete([]);
$countBefore = \count($this->tableGateway->select());

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');

$countAfter = \count($this->tableGateway->select());

expect($countBefore)->toBe(0);
expect($countAfter)->toBe(1);

});

it('show error page, idempotent for error exist check in DB', function() {

$countBefore = \count($this->tableGateway->select());

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');

$countAfter = \count($this->tableGateway->select());

expect($countBefore)->toBe(1);
expect($countAfter)->toBe(1);

});

});

});
20 changes: 0 additions & 20 deletions spec/Integration/IntegrationViaErrorPreviewControllerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,4 @@
});
});

describe('/error-preview/fatal', function() {

it('show error page', function() {

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');
expect($this->application->getResponse()->getStatusCode())->toBe(500);

});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,4 @@

});

describe('/error-preview/fatal', function() {

it('show error page for fatal error', function() {

Quit::disable();

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');
expect($this->application->getResponse()->getStatusCode())->toBe(500);

});

});

});
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,4 @@

});

describe('/error-preview/fatal', function() {

it('show error page for fatal error', function() {

Quit::disable();

$request = $this->application->getRequest();
$request->setMethod('GET');
$request->setUri('http://example.com/error-preview/fatal');
$request->setRequestUri('/error-preview/fatal');

\ob_start();
$this->application->run();
$content = \ob_get_clean();

expect($content)->toContain('<title>Error');
expect($content)->toContain('<p>We have encountered a problem and we can not fulfill your request');
expect($this->application->getResponse()->getStatusCode())->toBe(500);

});

});

});

0 comments on commit eb05207

Please sign in to comment.