first commit

This commit is contained in:
ry-yamafuji 2023-08-11 21:55:16 +09:00
commit 4de0ac94f2
12 changed files with 14202 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
docs/

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"robberphex.php-debug"
]
}

18
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
// ADD
"pathMappings": {
"/var/www/html/":"${workspaceRoot}/src"
},
}
]
}

14
README.md Normal file
View File

@ -0,0 +1,14 @@
# php_testcase_create
PHPによりテストケース作成を支援するライブラリ
Author : ry.yamafuji
Crateddate : 2023/08/11
lisence : MIT
---
## Function
* OpenAPIを読み込みMD形式のテストケースに変換する
* YAMLファイルを読み込む機能

15
docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: '3'
services:
php:
build:
context: ./docker
container_name: php-xdebug
stdin_open: true
tty: true
ports:
- '80:80'
volumes:
- ./src:/var/www/html
- ./docker/php.ini:/usr/local/etc/php/php.ini

16
docker/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM php:7.4-apache
RUN apt-get update && apt-get install -y \
vim \
zip \
unzip
# composerのインストール
RUN cd /usr/bin && curl -s http://getcomposer.org/installer | php && ln -s /usr/bin/composer.phar /usr/bin/composer
# install xdebug
RUN pecl install xdebug-2.9.8 \
&& docker-php-ext-enable xdebug

9
docker/php.ini Normal file
View File

@ -0,0 +1,9 @@
[xdebug]
; ホストを指定
xdebug.remote_host = host.docker.internal
; リモートデバッグを有効化
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
; ホスト側のポート指定
xdebug.remote_port = 9003

1
src/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
vendor/

5
src/composer.json Normal file
View File

@ -0,0 +1,5 @@
{
"require": {
"symfony/yaml": "^5.4"
}
}

243
src/composer.lock generated Normal file
View File

@ -0,0 +1,243 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0c3ba147c0e4705e712772699329c079",
"packages": [
{
"name": "symfony/deprecation-contracts",
"version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"files": [
"function.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2022-01-02T09:53:40+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.4.23",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "4cd2e3ea301aadd76a4172756296fe552fb45b0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4cd2e3ea301aadd76a4172756296fe552fb45b0b",
"reference": "4cd2e3ea301aadd76a4172756296fe552fb45b0b",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<5.3"
},
"require-dev": {
"symfony/console": "^5.3|^6.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"bin": [
"Resources/bin/yaml-lint"
],
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.4.23"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2023-04-23T19:33:36+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
}

18
src/index.php Normal file
View File

@ -0,0 +1,18 @@
<?php
$timer_start = microtime(true);// 実行開始速度
require __DIR__ . '/vendor/autoload.php';
$filename = 'openapi.yaml';
$input = file_get_contents($filename);
$result = \Symfony\Component\Yaml\Yaml::parse($input);
$timer_end = microtime(true);// 実行終了速度
$timer = $timer_end - $timer_start;
echo '実行速度:'.ceil($timer*1000)."ms: $timer";

13857
src/openapi.yaml Normal file

File diff suppressed because it is too large Load Diff