From 4429d7ec8484c85b006a745016783c1a27e2a27d Mon Sep 17 00:00:00 2001 From: Arhell Date: Sat, 19 Feb 2022 14:58:20 +0200 Subject: [PATCH 1/2] update links --- src/Codeception/Module/PhpBrowser.php | 8 ++++---- tests/data/app/view/external_url.php | 2 +- tests/unit/Codeception/Module/PhpBrowserTest.php | 4 ++-- tests/unit/Codeception/Module/TestsForBrowsers.php | 4 ++-- tests/unit/Codeception/Module/TestsForWeb.php | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Codeception/Module/PhpBrowser.php b/src/Codeception/Module/PhpBrowser.php index 0222876..6b6f90e 100644 --- a/src/Codeception/Module/PhpBrowser.php +++ b/src/Codeception/Module/PhpBrowser.php @@ -33,13 +33,13 @@ * * * url *required* - start url of your app * * headers - default headers are set before each test. - * * handler (default: curl) - Guzzle handler to use. By default curl is used, also possible to pass `stream`, or any valid class name as [Handler](http://docs.guzzlephp.org/en/latest/handlers-and-middleware.html#handlers). + * * handler (default: curl) - Guzzle handler to use. By default curl is used, also possible to pass `stream`, or any valid class name as [Handler](https://docs.guzzlephp.org/en/latest/handlers-and-middleware.html#handlers). * * middleware - Guzzle middlewares to add. An array of valid callables is required. * * curl - curl options * * cookies - ... * * auth - ... * * verify - ... - * * .. those and other [Guzzle Request options](http://docs.guzzlephp.org/en/latest/request-options.html) + * * .. those and other [Guzzle Request options](https://docs.guzzlephp.org/en/latest/request-options.html) * * * ### Example (`acceptance.suite.yml`) @@ -74,7 +74,7 @@ * * Properties: * - * * `guzzle` - contains [Guzzle](http://guzzlephp.org/) client instance: `\GuzzleHttp\Client` + * * `guzzle` - contains [Guzzle](https://guzzlephp.org/) client instance: `\GuzzleHttp\Client` * * `client` - Symfony BrowserKit instance. * */ @@ -193,7 +193,7 @@ protected function onReconfigure() /** * Low-level API method. - * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly + * If Codeception commands are not enough, use [Guzzle HTTP Client](https://guzzlephp.org/) methods directly * * Example: * diff --git a/tests/data/app/view/external_url.php b/tests/data/app/view/external_url.php index 4b2be70..ca0435a 100644 --- a/tests/data/app/view/external_url.php +++ b/tests/data/app/view/external_url.php @@ -1,5 +1,5 @@ - Next + Next \ No newline at end of file diff --git a/tests/unit/Codeception/Module/PhpBrowserTest.php b/tests/unit/Codeception/Module/PhpBrowserTest.php index c9127c7..1d9e39d 100644 --- a/tests/unit/Codeception/Module/PhpBrowserTest.php +++ b/tests/unit/Codeception/Module/PhpBrowserTest.php @@ -512,11 +512,11 @@ public function testCookiesForDomain() $handler = GuzzleHandlerStack::create($mock); $handler->push(GuzzleMiddleware::history($this->history)); - $client = new GuzzleClient(['handler' => $handler, 'base_uri' => 'http://codeception.com']); + $client = new GuzzleClient(['handler' => $handler, 'base_uri' => 'https://codeception.com']); $guzzleConnector = new Guzzle(); $guzzleConnector->setClient($client); $guzzleConnector->getCookieJar()->set(new Cookie('hello', 'world')); - $guzzleConnector->request('GET', 'http://codeception.com/'); + $guzzleConnector->request('GET', 'https://codeception.com/'); $this->assertArrayHasKey('cookies', $this->history[0]['options']); /** @var $cookie GuzzleHttp\Cookie\SetCookie **/ $cookies = $this->history[0]['options']['cookies']->toArray(); diff --git a/tests/unit/Codeception/Module/TestsForBrowsers.php b/tests/unit/Codeception/Module/TestsForBrowsers.php index ddf2c28..eb42cf8 100644 --- a/tests/unit/Codeception/Module/TestsForBrowsers.php +++ b/tests/unit/Codeception/Module/TestsForBrowsers.php @@ -17,11 +17,11 @@ abstract class TestsForBrowsers extends TestsForWeb public function testAmOnSubdomain() { - $this->module->_reconfigure(['url' => 'http://google.com']); + $this->module->_reconfigure(['url' => 'https://google.com']); $this->module->amOnSubdomain('user'); $this->assertEquals('http://user.google.com', $this->module->_getUrl()); - $this->module->_reconfigure(['url' => 'http://www.google.com']); + $this->module->_reconfigure(['url' => 'https://www.google.com']); $this->module->amOnSubdomain('user'); $this->assertEquals('http://user.google.com', $this->module->_getUrl()); } diff --git a/tests/unit/Codeception/Module/TestsForWeb.php b/tests/unit/Codeception/Module/TestsForWeb.php index f4c817d..a15e114 100644 --- a/tests/unit/Codeception/Module/TestsForWeb.php +++ b/tests/unit/Codeception/Module/TestsForWeb.php @@ -119,9 +119,9 @@ public function testSeeLink() { $this->module->amOnPage('/external_url'); $this->module->seeLink('Next'); - $this->module->seeLink('Next', 'http://codeception.com/'); + $this->module->seeLink('Next', 'https://codeception.com/'); // Without TLD and trailing slash - $this->module->dontSeeLink('Next', 'http://codeception'); + $this->module->dontSeeLink('Next', 'https://codeception'); } public function testDontSeeLink() @@ -150,9 +150,9 @@ public function testSeeLinkFailsIfHrefDoesNotMatch() public function testSeeLinkFailsIfHrefDoesNotMatchExactly() { $this->expectException(AssertionFailedError::class); - $this->expectExceptionMessage("No links containing text 'Next' and URL 'http://codeception' were found in page /external_url"); + $this->expectExceptionMessage("No links containing text 'Next' and URL 'https://codeception' were found in page /external_url"); $this->module->amOnPage('/external_url'); - $this->module->seeLink('Next', 'http://codeception'); + $this->module->seeLink('Next', 'https://codeception'); } public function testDontSeeLinkFailsIfTextMatches() @@ -166,9 +166,9 @@ public function testDontSeeLinkFailsIfTextMatches() public function testDontSeeLinkFailsIfTextAndUrlMatches() { $this->expectException(AssertionFailedError::class); - $this->expectExceptionMessage("Link containing text 'Next' and URL 'http://codeception.com/' was found in page /external_url"); + $this->expectExceptionMessage("Link containing text 'Next' and URL 'https://codeception.com/' was found in page /external_url"); $this->module->amOnPage('/external_url'); - $this->module->dontSeeLink('Next', 'http://codeception.com/'); + $this->module->dontSeeLink('Next', 'https://codeception.com/'); } public function testSeeLinkMatchesRelativeLink() From 70c9934a118638a96f5efad290f15a568a11d583 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sat, 19 Feb 2022 20:21:21 +0200 Subject: [PATCH 2/2] Fix broken test --- tests/unit/Codeception/Module/TestsForBrowsers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/Codeception/Module/TestsForBrowsers.php b/tests/unit/Codeception/Module/TestsForBrowsers.php index eb42cf8..3edac74 100644 --- a/tests/unit/Codeception/Module/TestsForBrowsers.php +++ b/tests/unit/Codeception/Module/TestsForBrowsers.php @@ -19,11 +19,11 @@ public function testAmOnSubdomain() { $this->module->_reconfigure(['url' => 'https://google.com']); $this->module->amOnSubdomain('user'); - $this->assertEquals('http://user.google.com', $this->module->_getUrl()); + $this->assertEquals('https://user.google.com', $this->module->_getUrl()); $this->module->_reconfigure(['url' => 'https://www.google.com']); $this->module->amOnSubdomain('user'); - $this->assertEquals('http://user.google.com', $this->module->_getUrl()); + $this->assertEquals('https://user.google.com', $this->module->_getUrl()); } public function testOpenAbsoluteUrls() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy