Skip to content

Commit

Permalink
Fixed SSL setup for test
Browse files Browse the repository at this point in the history
  • Loading branch information
arzola committed Jun 3, 2021
1 parent 3de0d2f commit 2fa944f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test-datacollector-book.php
Expand Up @@ -29,6 +29,7 @@ public static function tearDownAfterClass() {
// Put the hooks back in place
$obj = BookDataCollector::init();
$obj::hooks( $obj );
$_SERVER['SERVER_PORT'] = '';
}


Expand Down Expand Up @@ -221,7 +222,7 @@ public function test_getCoverThumbnail() {
$path = $this->bookDataCollector->getCoverThumbnail( $blog_id, 'http://presssbooks.test/server-whitout-ssl-image.jpg' );
$this->assertEquals( 'http://presssbooks.test/server-whitout-ssl-image.jpg', $path );

$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = '443';

$path = $this->bookDataCollector->getCoverThumbnail( $blog_id, 'http://presssbooks.test/https-cover-image.jpg' );
$this->assertEquals( 'https://presssbooks.test/https-cover-image.jpg', $path );
Expand All @@ -232,8 +233,6 @@ public function test_getCoverThumbnail() {
$path = $this->bookDataCollector->getCoverThumbnail( $blog_id, $attachment_path, $attachment_id );

$this->assertEquals( 1, preg_match( '/https:\/\/.*-768x1024\.jpg/', $path ) );

$_SERVER['HTTPS'] = 'off';
}


Expand Down

0 comments on commit 2fa944f

Please sign in to comment.