Compare commits

..

No commits in common. "f3a7e8f04d55b41b847faf5d6d7472c3dfb6a3e3" and "d713429d8867c84bd598050dd51cf9729097bc81" have entirely different histories.

13 changed files with 31 additions and 58 deletions

View File

@ -46,7 +46,7 @@ tooling-php-shell: tooling-docker
docker exec -it $(call translate-container-name,tooling_php_1) sh docker exec -it $(call translate-container-name,tooling_php_1) sh
acceptance-and-accessibility: tooling-docker acceptance-and-accessibility: tooling-docker
docker exec -it $(call translate-container-name,tooling_php_1) /var/tooling/acceptance_and_accessibility.sh docker exec -it $(call translate-container-name,tooling_php_1) sh -c "SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/codecept run"
test: tooling-docker test: tooling-docker
docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'') docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'')

View File

@ -112,7 +112,11 @@
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
"App\\Tests\\": "tests/" "App\\Tests\\": "tests/"
} },
"files": [
"tests/CodeCeption/_support/_generated/AcceptanceTesterActions.php",
"tests/CodeCeption/_support/AcceptanceTester.php"
]
}, },
"replace": { "replace": {
"paragonie/random_compat": "2.*", "paragonie/random_compat": "2.*",

1
docker/accessibility Submodule

@ -0,0 +1 @@
Subproject commit abcd45f8ecd361ae1b84cc40df4dbf2548735035

View File

@ -7,4 +7,4 @@ RUN apk update \
&& pecl install xdebug \ && pecl install xdebug \
&& docker-php-ext-enable xdebug && docker-php-ext-enable xdebug
RUN apk add --no-cache openssh sshpass RUN apk add npm && npm install -g pa11y

View File

@ -1,3 +0,0 @@
#!/bin/sh
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/codecept run

View File

@ -2,11 +2,10 @@ version: '3'
services: services:
php: php:
build: php build: .
depends_on: depends_on:
- db - db
- redis - redis
- pa11y
volumes: volumes:
# Entrypoint # Entrypoint
- ../php/entrypoint.sh:/entrypoint.sh - ../php/entrypoint.sh:/entrypoint.sh
@ -14,7 +13,6 @@ services:
- ../social/install.sh:/var/entrypoint.d/0_social_install.sh - ../social/install.sh:/var/entrypoint.d/0_social_install.sh
- ./coverage.sh:/var/tooling/coverage.sh - ./coverage.sh:/var/tooling/coverage.sh
- ./phpstan.sh:/var/tooling/phpstan.sh - ./phpstan.sh:/var/tooling/phpstan.sh
- ./acceptance_and_accessibility.sh:/var/tooling/acceptance_and_accessibility.sh
# Main files # Main files
- ../../:/var/www/social - ../../:/var/www/social
- /var/www/social/docker # exclude docker folder - /var/www/social/docker # exclude docker folder
@ -30,6 +28,9 @@ services:
- php - php
restart: always restart: always
tty: false tty: false
# ports:
# - "8080:80"
# - "4443:443"
volumes: volumes:
# Nginx # Nginx
- ../nginx/nginx.conf:/var/nginx/social.conf - ../nginx/nginx.conf:/var/nginx/social.conf
@ -43,13 +44,6 @@ services:
- ../bootstrap/bootstrap.env - ../bootstrap/bootstrap.env
command: /bin/sh -c '/var/nginx/domain.sh; nginx -g "daemon off;"' command: /bin/sh -c '/var/nginx/domain.sh; nginx -g "daemon off;"'
pa11y:
build: pa11y
volumes:
- ../../tests/CodeCeption/pa11y-config.json:/pa11y/config.json
cap_add:
- SYS_ADMIN
db: db:
image: postgres:alpine image: postgres:alpine
environment: environment:

View File

@ -1,8 +0,0 @@
FROM node
RUN apt-get update && apt-get -y install npm openssh-server && npm install -g pa11y
COPY sshd_config /etc/ssh/sshd_config
RUN echo 'root:pa11y' | chpasswd
ENTRYPOINT service ssh start && sleep infinity

View File

@ -1,7 +0,0 @@
ChallengeResponseAuthentication no
ListenAddress 0.0.0.0
PasswordAuthentication yes
PermitEmptyPasswords yes
PermitRootLogin yes
Port 22

View File

@ -25,11 +25,6 @@ parameters:
message: '/^Property App\\PHPStan\\ClassFromTableNameDynamicStaticMethodReturnTypeExtension::\$provider is never read, only written\./' message: '/^Property App\\PHPStan\\ClassFromTableNameDynamicStaticMethodReturnTypeExtension::\$provider is never read, only written\./'
path: src/PHPStan/ClassFromTableNameDynamicStaticMethodReturnTypeExtension.php path: src/PHPStan/ClassFromTableNameDynamicStaticMethodReturnTypeExtension.php
-
message: '/Access to constant STANDARD_WCAG2A?A?A? on an unknown class Helper\\AccessibilityValidator/'
paths:
- *
# - # -
# message: '/has no return typehint specified/' # message: '/has no return typehint specified/'
# paths: # paths:

View File

@ -92,16 +92,21 @@ class AccessibilityValidator extends \Codeception\Module
throw new Exception('Unknown standard: ' . $standard); throw new Exception('Unknown standard: ' . $standard);
} }
exec('sshpass -p pa11y ssh -o StrictHostKeyChecking=no pa11y 2>/dev/null pa11y -c /pa11y/config.json' . ' -s ' . $standard . " -r json '" . addslashes($url) . "'", $output); $pa11yPath = $this->_getConfig('pa11yPath');
if (!$pa11yPath) {
if (!empty($output)) { $pa11yPath = 'pa11y';
$data = json_decode($output[0], true);
if (!$data) {
throw new Exception('Invalid data returned from validation service: ' . implode("\n", $output));
}
return $data;
} }
return []; if (!file_exists($pa11yPath)) {
throw new Exception('pa11y not found: ' . $pa11yPath);
}
exec($pa11yPath . ' -s ' . $standard . " -r json '" . addslashes($url) . "'", $return);
$data = json_decode($return[0], true);
if (!$data) {
$msg = 'Invalid data returned from validation service: ';
throw new Exception($msg . $return);
}
return $data;
} }
/** /**

View File

@ -2,12 +2,15 @@
declare(strict_types = 1); declare(strict_types = 1);
class LoggedOutCest class FirstCest
{ {
public function _before(AcceptanceTester $I)
{
}
public function root(AcceptanceTester $I) public function root(AcceptanceTester $I)
{ {
$I->amOnPage('/'); $I->amOnPage('/');
$I->see('Feed'); $I->see('Feed');
$I->validatePa11y(\Helper\AccessibilityValidator::STANDARD_WCAG2AAA);
} }
} }

View File

@ -1,5 +0,0 @@
{
"chromeLaunchConfig": {
"args": ["--no-sandbox"]
}
}

View File

@ -1,6 +0,0 @@
{
"chromeLaunchConfig": {
"args": ["--no-sandbox"],
"ignoreHTTPSErrors": true
}
}