-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Deprecate module
- Loading branch information
Showing
9 changed files
with
180 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: 2 | ||
# CircleCI integration with Drupal 8. | ||
|
||
## Defines images and working directory. | ||
defaults: &defaults | ||
docker: | ||
- image: pookmish/drupal8ci:pcov | ||
- image: selenium/standalone-chrome:latest | ||
- image: mariadb:10.3 | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 1 | ||
working_directory: /var/www/html | ||
|
||
back_to_dev: &back_to_dev | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: | ||
name: Back to dev | ||
command: | | ||
composer global require SU-SWS/stanford-caravan:dev-8.x-2.x | ||
~/.composer/vendor/bin/sws-caravan back-to-dev ${CIRCLE_TAG} ${CIRCLE_WORKING_DIRECTORY} | ||
# Declare all of the jobs we should run. | ||
jobs: | ||
run-back-to-dev: | ||
<<: *back_to_dev | ||
|
||
# Declare a workflow that runs all of our jobs in parallel. | ||
workflows: | ||
version: 2 | ||
after_release: | ||
jobs: | ||
- run-back-to-dev: | ||
filters: | ||
tags: | ||
only: | ||
- /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*).*?$/ | ||
branches: | ||
ignore: | ||
- /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PHPUnit and Acceptance Tests | ||
on: [push] | ||
jobs: | ||
phpunit: | ||
name: PHPUnit Coverage Tests | ||
runs-on: ubuntu-latest | ||
container: | ||
image: pookmish/drupal8ci:php8 | ||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_DATABASE: drupal | ||
MYSQL_USER: drupal | ||
MYSQL_PASSWORD: drupal | ||
MYSQL_ROOT_PASSWORD: drupal | ||
ports: | ||
- 33306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: project | ||
- name: Build project | ||
run: | | ||
composer global require fzaninotto/faker:'dev-master as 1.9.2' | ||
composer global require SU-SWS/stanford-caravan:dev-8.x-2.x | ||
~/.composer/vendor/bin/sws-caravan phpunit /var/www/html --extension-dir=$GITHUB_WORKSPACE/project --with-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: 'No Bots' | ||
type: module | ||
description: 'Blocks (well-behaved) search engine robots from crawling, indexing, or archiving your site.' | ||
version: 8.x-2.1 | ||
version: 8.x-2.2 | ||
core_version_requirement: ^8.8 || ^9 | ||
package: Stanford | ||
lifecycle: deprecated | ||
lifecycle_link: https://github.com/SU-SWS/nobots/blob/8.x-2.x/README.md#deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Drupal\Tests\nobots\Kernel; | ||
|
||
use Drupal\KernelTests\KernelTestBase; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\Event\ResponseEvent; | ||
use Symfony\Component\HttpKernel\HttpKernelInterface; | ||
use Symfony\Component\HttpKernel\KernelEvents; | ||
|
||
/** | ||
* Nobots tests. | ||
* | ||
* @coversDefaultClass \Drupal\nobots\EventSubscriber\FinishResponseSubscriber | ||
*/ | ||
class NobotsTest extends KernelTestBase { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $modules = ['system', 'nobots']; | ||
|
||
/** | ||
* Test kernel event subscriber. | ||
*/ | ||
public function testKernelEvent() { | ||
$request = new Request(); | ||
$response = new Response(); | ||
|
||
$event = new ResponseEvent( | ||
$this->createMock(HttpKernelInterface::class), | ||
$request, | ||
HttpKernelInterface::MASTER_REQUEST, | ||
$response | ||
); | ||
|
||
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher */ | ||
$event_dispatcher = \Drupal::service('event_dispatcher'); | ||
$event_dispatcher->dispatch($event, KernelEvents::RESPONSE); | ||
|
||
$this->assertEmpty($event->getResponse()->headers->get('X-Robots-Tag')); | ||
\Drupal::state()->set('nobots',true); | ||
|
||
$event_dispatcher->dispatch($event, KernelEvents::RESPONSE); | ||
$this->assertNotEmpty($event->getResponse()->headers->get('X-Robots-Tag')); | ||
} | ||
|
||
} |