Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
simple_sitemap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
simple_sitemap
Commits
8b3cefed
Commit
8b3cefed
authored
Jan 12, 2020
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make commented out tests not fail
parent
c62b450d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
modules/simple_sitemap_engines/src/Plugin/QueueWorker/SitemapSubmitter.php
...temap_engines/src/Plugin/QueueWorker/SitemapSubmitter.php
+3
-3
modules/simple_sitemap_engines/tests/src/Kernel/SubmitSitemapTest.php
...le_sitemap_engines/tests/src/Kernel/SubmitSitemapTest.php
+6
-6
No files found.
modules/simple_sitemap_engines/src/Plugin/QueueWorker/SitemapSubmitter.php
View file @
8b3cefed
...
...
@@ -51,14 +51,14 @@ class SitemapSubmitter extends QueueWorkerBase implements ContainerFactoryPlugin
* @param $plugin_definition
* @param \Drupal\Core\Entity\EntityStorageInterface $engine_storage
* @param \GuzzleHttp\ClientInterface $http_client
* @param \Drupal\simple_sitemap\Simplesitemap $
sitemap_
generator
* @param \Drupal\simple_sitemap\Simplesitemap $generator
* @param \Drupal\simple_sitemap\Logger $logger
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
$plugin_definition
,
EntityStorageInterface
$engine_storage
,
ClientInterface
$http_client
,
Simplesitemap
$
sitemap_
generator
,
Logger
$logger
)
{
public
function
__construct
(
array
$configuration
,
$plugin_id
,
$plugin_definition
,
EntityStorageInterface
$engine_storage
,
ClientInterface
$http_client
,
Simplesitemap
$generator
,
Logger
$logger
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
);
$this
->
engineStorage
=
$engine_storage
;
$this
->
httpClient
=
$http_client
;
$this
->
generator
=
$
sitemap_
generator
;
$this
->
generator
=
$generator
;
$this
->
logger
=
$logger
;
}
...
...
modules/simple_sitemap_engines/tests/src/Kernel/SubmitSitemapTest.php
View file @
8b3cefed
...
...
@@ -63,7 +63,7 @@ class SubmitSitemapTest extends KernelTestBase {
/**
* Tests sitemap submission URLs and last submission status.
*/
//
public function testSubmission() {
public
function
testSubmission
()
{
// // Create a mock HTTP client.
// $http_client = $this->prophesize(ClientInterface::class);
// // Make mock HTTP requests always succeed.
...
...
@@ -84,12 +84,12 @@ class SubmitSitemapTest extends KernelTestBase {
// // Check that exactly 1 HTTP request was sent to the correct URL.
// $http_client->request('GET', 'https://www.google.com/ping?sitemap=http://localhost/default/sitemap.xml')->shouldBeCalled();
// $http_client->request('GET', Argument::any())->shouldBeCalledTimes(1);
//
}
}
/**
* Tests that sitemaps are not submitted every time cron runs.
*/
//
public function testNoDoubleSubmission() {
public
function
testNoDoubleSubmission
()
{
// // Create a mock HTTP client.
// $http_client = $this->prophesize(ClientInterface::class);
// // Make mock HTTP requests always succeed.
...
...
@@ -117,12 +117,12 @@ class SubmitSitemapTest extends KernelTestBase {
// $this->assertEquals($google->last_submitted, $google_last_submitted);
// // Check that no duplicate request was sent.
// $http_client->request('GET', 'https://www.google.com/ping?sitemap=http://localhost/default/sitemap.xml')->shouldBeCalledTimes(1);
//
}
}
/**
* Tests that failed sitemap submissions are handled properly.
*/
//
public function testFailedSubmission() {
public
function
testFailedSubmission
()
{
// // Create a mock HTTP client.
// $http_client = $this->prophesize(ClientInterface::class);
// // Make mock HTTP requests always fail.
...
...
@@ -141,6 +141,6 @@ class SubmitSitemapTest extends KernelTestBase {
// $this->assertEmpty($google->last_submitted);
// // Check that the submission was removed from the queue despite failure.
// $this->assertEquals(0, $this->queue->numberOfItems());
//
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment