Skip to content

Commit aecf4a3

Browse files
committed
Add Operation tests
1 parent a0f1b69 commit aecf4a3

File tree

5,841 files changed

+153041
-99803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,841 files changed

+153041
-99803
lines changed

Makefile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# set all to phony
2+
SHELL=bash
3+
4+
.PHONY: *
5+
6+
DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l)
7+
COMPOSER_CACHE_DIR:=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache)
8+
9+
ifneq ("$(wildcard /.dockerenv)","")
10+
IN_DOCKER:=TRUE
11+
else ifneq ("$(DOCKER_CGROUP)","0")
12+
IN_DOCKER:=TRUE
13+
else
14+
IN_DOCKER:=FALSE
15+
endif
16+
17+
ifeq ("$(IN_DOCKER)","TRUE")
18+
DOCKER_RUN:=
19+
else
20+
PHP_VERSION:=$(shell docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.config.platform.php' "`pwd`/composer.json" | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN), 2)), 2)[0]);")
21+
DOCKER_RUN:=docker run --rm -it \
22+
-v "`pwd`:`pwd`" \
23+
-v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \
24+
-w "`pwd`" \
25+
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine-slim-dev"
26+
endif
27+
28+
all: ## Runs everything ###
29+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
30+
31+
syntax-php: ## Lint PHP syntax
32+
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
33+
34+
cs-fix: ## Fix any automatically fixable code style issues
35+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml
36+
37+
cs: ## Check the code for code style issues
38+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml
39+
40+
stan: ## Run static analysis (PHPStan)
41+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon
42+
43+
psalm: ## Run static analysis (Psalm)
44+
$(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml
45+
46+
unit-testing: ## Run tests
47+
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
48+
$(DOCKER_RUN) test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
49+
50+
mutation-testing: ## Run mutation testing
51+
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false)
52+
53+
backward-compatibility-check: ## Check code for backwards incompatible changes
54+
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true
55+
56+
shell: ## Provides Shell access in the expected environment ###
57+
$(DOCKER_RUN) ash
58+
59+
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ###
60+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
61+
62+
help: ## Show this help ###
63+
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
64+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#'

blaat

Whitespace-only changes.

etc/openapi-generator-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
spec: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/ghec/ghec.yaml
2-
namespace: ApiClients\Client\GitHubEnterpriseCloud
2+
namespace:
3+
source: ApiClients\Client\Github
4+
test: ApiClients\Tests\Client\Github
35
destination:
46
root: ../
57
source: src
68
test: tests
9+
templates:
10+
dir: ../templates
711
schemas:
812
allowDuplication: true
913
useAliasesForDuplication: true

src/Client.php

Lines changed: 16552 additions & 7362 deletions
Large diffs are not rendered by default.

src/ClientInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud;
4+
namespace ApiClients\Client\Github;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
interface ClientInterface
1212
{
1313
/**

src/Error/BasicError.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud\Error;
4+
namespace ApiClients\Client\Github\Error;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
final class BasicError extends \Error
1212
{
1313
public function __construct(public int $status, public Schema\BasicError $error)

src/Error/Operation/CodeScanning/ListAlertsForEnterprise/Response/Applicationjson/H503.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud\Error\Operation\CodeScanning\ListAlertsForEnterprise\Response\Applicationjson;
4+
namespace ApiClients\Client\Github\Error\Operation\CodeScanning\ListAlertsForEnterprise\Response\Applicationjson;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
final class H503 extends \Error
1212
{
1313
public function __construct(public int $status, public Schema\Operation\CodeScanning\ListAlertsForEnterprise\Response\Applicationjson\H503 $error)

src/Error/Operation/Gists/CheckIsStarred/Response/Applicationjson/H404.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud\Error\Operation\Gists\CheckIsStarred\Response\Applicationjson;
4+
namespace ApiClients\Client\Github\Error\Operation\Gists\CheckIsStarred\Response\Applicationjson;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
final class H404 extends \Error
1212
{
1313
public function __construct(public int $status, public Schema\Operation\Gists\CheckIsStarred\Response\Applicationjson\H404 $error)

src/Error/Operation/Gists/Get/Response/Applicationjson/H403.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud\Error\Operation\Gists\Get\Response\Applicationjson;
4+
namespace ApiClients\Client\Github\Error\Operation\Gists\Get\Response\Applicationjson;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
final class H403 extends \Error
1212
{
1313
public function __construct(public int $status, public Schema\Operation\Gists\Get\Response\Applicationjson\H403 $error)

src/Error/Operation/Orgs/RemoveOutsideCollaborator/Response/Applicationjson/H422.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
declare (strict_types=1);
4-
namespace ApiClients\Client\GitHubEnterpriseCloud\Error\Operation\Orgs\RemoveOutsideCollaborator\Response\Applicationjson;
4+
namespace ApiClients\Client\Github\Error\Operation\Orgs\RemoveOutsideCollaborator\Response\Applicationjson;
55

6-
use ApiClients\Client\GitHubEnterpriseCloud\Error as ErrorSchemas;
7-
use ApiClients\Client\GitHubEnterpriseCloud\Hydrator;
8-
use ApiClients\Client\GitHubEnterpriseCloud\Operation;
9-
use ApiClients\Client\GitHubEnterpriseCloud\Schema;
10-
use ApiClients\Client\GitHubEnterpriseCloud\WebHook;
6+
use ApiClients\Client\Github\Error as ErrorSchemas;
7+
use ApiClients\Client\Github\Hydrator;
8+
use ApiClients\Client\Github\Operation;
9+
use ApiClients\Client\Github\Schema;
10+
use ApiClients\Client\Github\WebHook;
1111
final class H422 extends \Error
1212
{
1313
public function __construct(public int $status, public Schema\Operation\Orgs\RemoveOutsideCollaborator\Response\Applicationjson\H422 $error)

0 commit comments

Comments
 (0)