diff --git a/.github/actions/deploy/appinfo/info.xml.dist b/.github/actions/deploy/appinfo/info.xml.dist index 5ef8b2148..30eb48a17 100755 --- a/.github/actions/deploy/appinfo/info.xml.dist +++ b/.github/actions/deploy/appinfo/info.xml.dist @@ -18,7 +18,7 @@ https://raw.githubusercontent.com/nextcloud/cookbook/stable/img/screenshot2.png - + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44246c8b5..b40cb1c3f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -130,27 +130,7 @@ jobs: phpVersion: "8.1" httpServer: "apache" - # Test different core versions additionally with lower PHP versions - - database: mysql - coreVersion: stable19 - phpVersion: "7.4" - httpServer: "apache" - - database: mysql - coreVersion: stable20 - phpVersion: "7.4" - httpServer: "apache" - # Test different PHP versions additionally - # - database: mysql - # # stable24 branch needs PHP 7.4 - # coreVersion: stable23 - # phpVersion: "7.3" - # httpServer: "apache" - # - database: mysql - # coreVersion: stable24 - # # We have already PHP 7.4 with stable 19/20 - # phpVersion: "7.4" - # httpServer: "apache" - database: mysql coreVersion: stable24 phpVersion: "8.1" @@ -161,12 +141,6 @@ jobs: coreVersion: stable24 phpVersion: "8.1" httpServer: "nginx" - - # Test against master (optionally) - # - database: mysql - # coreVersion: master - # phpVersion: "8.1" - # httpServer: "apache" steps: - name: Checkout the app diff --git a/CHANGELOG.md b/CHANGELOG.md index 37d7c7b01..36722f1cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Added +- Create structure to run integration tests against a real database + [#1195](https://github.com/nextcloud/cookbook/pull/1195) @christianlupus + ### Changed - Migrate ILogger to LoggerInterface [#1192](https://github.com/nextcloud/cookbook/pull/1192) @miles170 @@ -7,11 +11,23 @@ ### Fixed - Close security issue by enabling CSRF protection on most endpoints [#1190](https://github.com/nextcloud/cookbook/pull/1190) @christianlupus +- Fix bug in DB access class to prevent PostgreSQL from viewing all recipes of a category + [#1195](https://github.com/nextcloud/cookbook/pull/1195) @christianlupus +- Fix minor bug to make API access consistent with API definitions and internal structure more well-defined + [#1195](https://github.com/nextcloud/cookbook/pull/1195) @christianlupus ### Documentation - Defining new API interface to fix security issue [#1186](https://github.com/nextcloud/cookbook/pull/1186) @christianlupus +### Deprecated +- Deprecate NC core version V21 + [#1195](https://github.com/nextcloud/cookbook/pull/1195) @christianlupus + +### Removed +- Removed support for NC core <= V20 + [#1195](https://github.com/nextcloud/cookbook/pull/1195) @christianlupus + ## 0.9.14 - 2022-08-29 diff --git a/appinfo/info.xml b/appinfo/info.xml index 10df39e25..3b3e75697 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -18,7 +18,7 @@ https://raw.githubusercontent.com/nextcloud/cookbook/stable/img/screenshot2.png - + diff --git a/composer.json b/composer.json index f903db507..0af3c068d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "ext-libxml": "*" }, "require-dev": { - "nextcloud/coding-standard": "^1.0.0" + "nextcloud/coding-standard": "^1.0.0", + "christophwurst/nextcloud_testing": "^0.12.4" }, "scripts": { "cs:check": "./vendor/bin/php-cs-fixer fix --dry-run --diff", @@ -23,5 +24,10 @@ "platform": { "php": "7.4" } + }, + "autoload-dev": { + "psr-4": { + "OCA\\Cookbook\\tests\\": "tests/" + } } } diff --git a/composer.lock b/composer.lock index 5dd0731ff..287c47307 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,54 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "faefca4ca0cc2a29adee4e600269238c", + "content-hash": "6480218e86f5119895994cd35c8b6f60", "packages": [], "packages-dev": [ + { + "name": "christophwurst/nextcloud_testing", + "version": "v0.12.4", + "source": { + "type": "git", + "url": "https://github.com/ChristophWurst/nextcloud_testing.git", + "reference": "9c189b01dbcc3508108f08c417de6aaea7005fb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ChristophWurst/nextcloud_testing/zipball/9c189b01dbcc3508108f08c417de6aaea7005fb0", + "reference": "9c189b01dbcc3508108f08c417de6aaea7005fb0", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "php-webdriver/webdriver": "^1.9", + "phpunit/phpunit": "^8.0|^9.0" + }, + "require-dev": { + "christophwurst/nextcloud": "^17.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ChristophWurst\\Nextcloud\\Testing\\": "/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Simple and fast unit and integration testing framework for Nextcloud, based on PHPUnit", + "support": { + "issues": "https://github.com/ChristophWurst/nextcloud_testing/issues", + "source": "https://github.com/ChristophWurst/nextcloud_testing/tree/v0.12.4" + }, + "time": "2021-02-18T08:41:09+00:00" + }, { "name": "composer/pcre", "version": "3.0.0", @@ -298,6 +343,76 @@ }, "time": "2022-07-02T10:48:51+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-03-03T08:28:38+00:00" + }, { "name": "doctrine/lexer", "version": "1.2.3", @@ -446,86 +561,1728 @@ "email": "fabien@symfony.com" }, { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.4" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2022-07-15T21:04:49+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2022-03-03T13:19:32+00:00" + }, + { + "name": "nextcloud/coding-standard", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nextcloud/coding-standard.git", + "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/f3d1f9375e89c605deb1734f59a9f51ecbe80578", + "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^3.2", + "php": "^7.3|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nextcloud\\CodingStandard\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Nextcloud coding standards for the php cs fixer", + "support": { + "issues": "https://github.com/nextcloud/coding-standard/issues", + "source": "https://github.com/nextcloud/coding-standard/tree/v1.0.0" + }, + "time": "2021-11-10T08:44:10+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + }, + "time": "2022-09-04T07:30:47+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, + { + "name": "php-webdriver/webdriver", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/php-webdriver/php-webdriver.git", + "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/b27ddf458d273c7d4602106fcaf978aa0b7fe15a", + "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-zip": "*", + "php": "^5.6 || ~7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.12", + "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0" + }, + "replace": { + "facebook/webdriver": "*" + }, + "require-dev": { + "ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", + "php-coveralls/php-coveralls": "^2.4", + "php-mock/php-mock-phpunit": "^1.1 || ^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", + "squizlabs/php_codesniffer": "^3.5", + "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0" + }, + "suggest": { + "ext-SimpleXML": "For Firefox profile creation" + }, + "type": "library", + "autoload": { + "files": [ + "lib/Exception/TimeoutException.php" + ], + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", + "homepage": "https://github.com/php-webdriver/php-webdriver", + "keywords": [ + "Chromedriver", + "geckodriver", + "php", + "selenium", + "webdriver" + ], + "support": { + "issues": "https://github.com/php-webdriver/php-webdriver/issues", + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.1" + }, + "time": "2022-05-03T12:16:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.14", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-08-30T12:24:04+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.24", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-08-30T07:42:16+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-04-03T09:37:03+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A tool to automatically fix PHP code style", + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.4" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, "funding": [ { - "url": "https://github.com/keradus", + "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2022-07-15T21:04:49+00:00" + "time": "2020-11-28T06:42:11+00:00" }, { - "name": "nextcloud/coding-standard", - "version": "v1.0.0", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/f3d1f9375e89c605deb1734f59a9f51ecbe80578", - "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": "^3.2", - "php": "^7.3|^8.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", - "autoload": { - "psr-4": { - "Nextcloud\\CodingStandard\\": "src" + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Nextcloud coding standards for the php cs fixer", + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.0.0" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, - "time": "2021-11-10T08:44:10+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -539,219 +2296,248 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" } ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, - "time": "2020-10-14T08:32:19+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, - "time": "2016-08-06T20:24:11+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" }, - "time": "2021-11-05T16:50:12+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "sebastian/type", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "fb44e1cc6e557418387ad815780360057e40753e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", + "reference": "fb44e1cc6e557418387ad815780360057e40753e", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.1-dev" } }, "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" }, - "time": "2019-01-08T18:20:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-08-29T06:55:37+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "symfony/console", @@ -2142,6 +3928,56 @@ } ], "time": "2022-06-26T15:57:47+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" } ], "aliases": [], diff --git a/cookbook.code-workspace b/cookbook.code-workspace index 1615d9dac..65f467f0c 100644 --- a/cookbook.code-workspace +++ b/cookbook.code-workspace @@ -41,6 +41,7 @@ "**/.history/**", "**/vendor/**/vendor/**", // "3rdparty/**" + ".github/actions/**", ], "cSpell.words": [ "Nextcloud" diff --git a/lib/Db/DbTypesPolyfillHelper.php b/lib/Db/DbTypesPolyfillHelper.php deleted file mode 100644 index 8262e0bcc..000000000 --- a/lib/Db/DbTypesPolyfillHelper.php +++ /dev/null @@ -1,58 +0,0 @@ -getVersion()[0]) { - case 18: - case 19: - case 20: - $this->int = \Doctrine\DBAL\Types\Type::INTEGER; - $this->string = \Doctrine\DBAL\Types\Type::STRING; - $this->date = \Doctrine\DBAL\Types\Type::DATE; - break; - - default: - $this->int = \OCP\DB\Types::INTEGER; - $this->string = \OCP\DB\Types::STRING; - $this->date = \OCP\DB\Types::DATE; - break; - } - } - - /** - * @return string - */ - final public function INT() { - return $this->int; - } - - /** - * @return string - */ - final public function STRING() { - return $this->string; - } - - /** - * @return string - */ - final public function DATE() { - return $this->date; - } -} diff --git a/lib/Db/RecipeDb.php b/lib/Db/RecipeDb.php index 4fe357fd1..b35f4bca1 100755 --- a/lib/Db/RecipeDb.php +++ b/lib/Db/RecipeDb.php @@ -6,6 +6,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\DB\Types; use OCP\IL10N; class RecipeDb { @@ -13,13 +14,9 @@ class RecipeDb { private const DB_TABLE_KEYWORDS = 'cookbook_keywords'; private const DB_TABLE_CATEGORIES = 'cookbook_categories'; + /** @var IDBConnection */ private $db; - /** - * @var DbTypesPolyfillHelper - */ - private $types; - /** * @var IL10N */ @@ -27,11 +24,9 @@ class RecipeDb { public function __construct( IDBConnection $db, - DbTypesPolyfillHelper $polyfillTypes, IL10N $l ) { $this->db = $db; - $this->types = $polyfillTypes; $this->l = $l; } @@ -97,8 +92,9 @@ public function findAllRecipes(string $user_id) { $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'k.name AS keywords', 'c.name AS category']) ->from(self::DB_TABLE_RECIPES, 'r') ->where('r.user_id = :user') - ->orderBy('r.name'); - $qb->setParameter('user', $user_id, $this->types->STRING()); + ->orderBy('r.name') + ->orderBy('k.name'); + $qb->setParameter('user', $user_id, Types::STRING); $qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k', $qb->expr()->andX( 'r.recipe_id = k.recipe_id', @@ -174,7 +170,7 @@ public function findAllKeywords(string $user_id) { ->where('user_id = :user AND k.name != \'\'') ->groupBy('k.name') ->orderBy('k.name'); - $qb->setParameter('user', $user_id, $this->types->STRING()); + $qb->setParameter('user', $user_id, Types::STRING); $cursor = $qb->execute(); $result = $cursor->fetchAll(); @@ -198,7 +194,7 @@ public function findAllCategories(string $user_id) { ->where('user_id = :user') ->groupBy('c.name') ->orderBy('c.name'); - $qb->setParameter('user', $user_id, $this->types->STRING()); + $qb->setParameter('user', $user_id, Types::STRING); $cursor = $qb->execute(); $result = $cursor->fetchAll(); @@ -255,13 +251,13 @@ public function getRecipesByCategory(string $category, string $user_id) { ->from(self::DB_TABLE_CATEGORIES, 'c') ->where('c.name = :category') ->andWhere('c.user_id = :user') - ->setParameter('category', $category, $this->types->STRING()) - ->setParameter('user', $user_id, $this->types->STRING()); + ->setParameter('category', $category, Types::STRING) + ->setParameter('user', $user_id, Types::STRING); $qb->join('c', self::DB_TABLE_RECIPES, 'r', 'c.recipe_id = r.recipe_id'); $qb->leftJoin('c', self::DB_TABLE_KEYWORDS, 'k', 'c.recipe_id = k.recipe_id'); - $qb->groupBy(['r.name', 'r.recipe_id', 'k.name']); + $qb->groupBy(['r.name', 'r.recipe_id', 'k.name', 'r.date_created','r.date_modified']); $qb->orderBy('r.name'); } else { $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'k.name AS keywords']) @@ -287,6 +283,14 @@ public function getRecipesByCategory(string $category, string $user_id) { $cursor->closeCursor(); $result = $this->mapDbNames($result); + $result = array_map(function ($x) use ($category) { + if ($category === '_') { + $x['category'] = null; + } else { + $x['category'] = $category; + } + return $x; + }, $result); // group recipes, convert keywords to comma-separated list $recipesGroupedTags = $this->groupKeywordInResult($result); @@ -303,17 +307,18 @@ public function getRecipesByKeywords(string $keywords, string $user_id) { $qb = $this->db->getQueryBuilder(); - $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'kk.name AS keywords']) - ->from(self::DB_TABLE_KEYWORDS, 'k') - ->where('k.name IN (:keywords)') - ->andWhere('k.user_id = :user') - ->having('COUNT(DISTINCT k.name) = :keywordsCount') - ->setParameter('user', $user_id, $this->types->INT()) - ->setParameter('keywords', $keywords_arr, IQueryBuilder::PARAM_STR_ARRAY) - ->setParameter('keywordsCount', sizeof($keywords_arr), $this->types->INT()); - $qb->join('k', self::DB_TABLE_RECIPES, 'r', 'k.recipe_id = r.recipe_id'); + $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'kk.name AS keywords', 'c.name AS category']) + ->from(self::DB_TABLE_KEYWORDS, 'k') + ->where('k.name IN (:keywords)') + ->andWhere('k.user_id = :user') + ->having('COUNT(DISTINCT k.name) = :keywordsCount') + ->setParameter('user', $user_id, Types::INTEGER) + ->setParameter('keywords', $keywords_arr, IQueryBuilder::PARAM_STR_ARRAY) + ->setParameter('keywordsCount', sizeof($keywords_arr), Types::INTEGER); + $qb->join('k', self::DB_TABLE_RECIPES, 'r', 'k.recipe_id = r.recipe_id') + ->join('r', self::DB_TABLE_CATEGORIES, 'c', 'c.recipe_id = r.recipe_id'); $qb->join('r', self::DB_TABLE_KEYWORDS, 'kk', 'kk.recipe_id = r.recipe_id'); - $qb->groupBy(['r.name', 'r.recipe_id', 'kk.name']); + $qb->groupBy(['r.name', 'r.recipe_id', 'kk.name', 'r.date_created', 'r.date_modified', 'c.name']); $qb->orderBy('r.name'); $cursor = $qb->execute(); @@ -340,11 +345,12 @@ public function findRecipes(array $keywords, string $user_id) { $qb = $this->db->getQueryBuilder(); - $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'k.name AS keywords', 'c.name AS category']) + $qb->select(['r.recipe_id', 'r.name', 'r.date_created', 'r.date_modified', 'kk.name AS keywords', 'c.name AS category']) ->from(self::DB_TABLE_RECIPES, 'r'); $qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'k', 'k.recipe_id = r.recipe_id'); $qb->leftJoin('r', self::DB_TABLE_CATEGORIES, 'c', 'r.recipe_id = c.recipe_id'); + $qb->leftJoin('r', self::DB_TABLE_KEYWORDS, 'kk', 'kk.recipe_id = r.recipe_id'); $paramIdx = 1; $params = []; @@ -358,16 +364,16 @@ public function findRecipes(array $keywords, string $user_id) { $qb->orWhere("LOWER(c.name) LIKE :keyword$paramIdx"); $params["keyword$paramIdx"] = "%$lowerKeyword%"; - $types["keyword$paramIdx"] = $this->types->STRING(); + $types["keyword$paramIdx"] = Types::STRING; $paramIdx++; } $qb->andWhere('r.user_id = :user'); $qb->setParameters($params, $types); - $qb->setParameter('user', $user_id, $this->types->STRING()); + $qb->setParameter('user', $user_id, Types::STRING); - $qb->groupBy(['r.name', 'r.recipe_id', 'k.name']); + $qb->groupBy(['r.name', 'r.recipe_id', 'kk.name', 'r.date_created', 'r.date_modified', 'c.name']); $qb->orderBy('r.name'); $cursor = $qb->execute(); @@ -406,27 +412,27 @@ public function groupKeywordInResult(array $result) { */ public function emptySearchIndex(string $user_id) { $qb = $this->db->getQueryBuilder(); - $qb->delete(self::DB_TABLE_RECIPES) ->where('user_id = :user') ->orWhere('user_id = :empty'); - $qb->setParameter('user', $user_id, $this->types->STRING()); - $qb->setParameter('empty', 'empty', $this->types->STRING()); - + $qb->setParameter('user', $user_id, Types::STRING); + $qb->setParameter('empty', 'empty', Types::STRING); $qb->execute(); + $qb = $this->db->getQueryBuilder(); $qb->delete(self::DB_TABLE_KEYWORDS) ->where('user_id = :user') ->orWhere('user_id = :empty'); - $qb->setParameter('user', $user_id, $this->types->STRING()); - $qb->setParameter('empty', 'empty', $this->types->STRING()); + $qb->setParameter('user', $user_id, Types::STRING); + $qb->setParameter('empty', 'empty', Types::STRING); + $qb->execute(); + $qb = $this->db->getQueryBuilder(); $qb->delete(self::DB_TABLE_CATEGORIES) ->where('user_id = :user') ->orWhere('user_id = :empty'); - $qb->setParameter('user', $user_id, $this->types->STRING()); - $qb->setParameter('empty', 'empty', $this->types->STRING()); - + $qb->setParameter('user', $user_id, Types::STRING); + $qb->setParameter('empty', 'empty', Types::STRING); $qb->execute(); } @@ -490,14 +496,14 @@ public function insertRecipes(array $recipes, string $userId) { $qb->setParameter('userid', $userId); foreach ($recipes as $recipe) { - $qb->setParameter('id', $recipe['id'], $this->types->INT()); - $qb->setParameter('name', $recipe['name'], $this->types->STRING()); + $qb->setParameter('id', $recipe['id'], Types::INTEGER); + $qb->setParameter('name', $recipe['name'], Types::STRING); $dateCreated = $this->parseDate($recipe['dateCreated']); - $qb->setParameter('dateCreated', $dateCreated, $this->types->DATE()); + $qb->setParameter('dateCreated', $dateCreated, Types::DATETIME); $dateModified = $this->parseDate($recipe['dateModified']); - $qb->setParameter('dateModified', $dateModified, $this->types->DATE()); + $qb->setParameter('dateModified', $dateModified, Types::DATETIME); $qb->execute(); } @@ -580,8 +586,8 @@ public function updateCategoryOfRecipe(int $recipeId, string $categoryName, stri $qb->update(self::DB_TABLE_CATEGORIES) ->where('recipe_id = :rid', 'user_id = :user'); $qb->set('name', $qb->createNamedParameter($categoryName, IQueryBuilder::PARAM_STR)); - $qb->setParameter('rid', $recipeId, $this->types->INT()); - $qb->setParameter('user', $userId, $this->types->STRING()); + $qb->setParameter('rid', $recipeId, Types::INTEGER); + $qb->setParameter('user', $userId, Types::STRING); $qb->execute(); } @@ -598,9 +604,9 @@ public function addCategoryOfRecipe(int $recipeId, string $categoryName, string $qb = $this->db->getQueryBuilder(); $qb->insert(self::DB_TABLE_CATEGORIES) ->values(['recipe_id' => ':rid', 'name' => ':name', 'user_id' => ':user']); - $qb->setParameter('rid', $recipeId, $this->types->INT()); - $qb->setParameter('name', $categoryName, $this->types->STRING()); - $qb->setParameter('user', $userId, $this->types->STRING()); + $qb->setParameter('rid', $recipeId, Types::INTEGER); + $qb->setParameter('name', $categoryName, Types::STRING); + $qb->setParameter('user', $userId, Types::STRING); try { $qb->execute(); @@ -613,8 +619,8 @@ public function removeCategoryOfRecipe(int $recipeId, string $userId) { $qb = $this->db->getQueryBuilder(); $qb->delete(self::DB_TABLE_CATEGORIES) ->where('recipe_id = :rid', 'user_id = :user'); - $qb->setParameter('rid', $recipeId, $this->types->INT()); - $qb->setParameter('user', $userId, $this->types->STRING()); + $qb->setParameter('rid', $recipeId, Types::INTEGER); + $qb->setParameter('user', $userId, Types::STRING); $qb->execute(); } @@ -626,11 +632,11 @@ public function addKeywordPairs(array $pairs, string $userId) { $qb = $this->db->getQueryBuilder(); $qb->insert(self::DB_TABLE_KEYWORDS) ->values(['recipe_id' => ':rid', 'name' => ':name', 'user_id' => ':user']); - $qb->setParameter('user', $userId, $this->types->STRING()); + $qb->setParameter('user', $userId, Types::STRING); foreach ($pairs as $p) { - $qb->setParameter('rid', $p['recipeId'], $this->types->INT()); - $qb->setParameter('name', $p['name'], $this->types->STRING()); + $qb->setParameter('rid', $p['recipeId'], Types::INTEGER); + $qb->setParameter('name', $p['name'], Types::STRING); try { $qb->execute(); diff --git a/tests/Integration/AbstractDatabaseTestCase.php b/tests/Integration/AbstractDatabaseTestCase.php new file mode 100644 index 000000000..1732d20c6 --- /dev/null +++ b/tests/Integration/AbstractDatabaseTestCase.php @@ -0,0 +1,48 @@ +startTransaction(); + + $app = new Application(); + $this->ncContainer = $app->getContainer(); + } + + protected function query(string $name) { + return $this->ncContainer->get($name); + } + + protected function tearDown(): void { + $this->rollbackTransation(); + parent::tearDown(); + + $this->resetDataFolder(); + } + + private function resetDataFolder() { + $cmd = "rsync -a --delete --delete-delay /dumps/current/plain/data/ /var/www/html/data"; + $output = []; + $ret = 0; + exec($cmd, $output, $ret); + + if ($ret !== 0) { + // The rsync did fail + echo "\nThe recovery of the data failed. Standard output:\n"; + print_r($output); + echo "The return code was $ret.\n"; + } + } +} diff --git a/tests/Integration/Db/RecipeDb/RecipeDbBigTest.php b/tests/Integration/Db/RecipeDb/RecipeDbBigTest.php new file mode 100644 index 000000000..74f591177 --- /dev/null +++ b/tests/Integration/Db/RecipeDb/RecipeDbBigTest.php @@ -0,0 +1,275 @@ +dut = $this->query(RecipeDb::class); + + $this->recipes = [ + [ + 'name' => 'Cooked Bananas', + 'id' => 1234, + 'dateCreated' => '2022-05-03 14:30:12', + 'dateModified' => null, + ], + [ + 'name' => 'Salad', + 'id' => 5678, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + ], + [ + 'name' => 'Pulled Beef', + 'id' => 2345, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + ], + [ + 'name' => 'Chicken', + 'id' => 3456, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + ], + [ + 'name' => 'Cake', + 'id' => 6789, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + ], + [ + 'name' => 'Water', + 'id' => 2, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + ], + ]; + $this->user = 'test-user'; + + $this->dut->insertRecipes($this->recipes, $this->user); + + $this->dut->addCategoryOfRecipe(1234, 'desert', $this->user); + $this->dut->addCategoryOfRecipe(5678, 'Opener', $this->user); + $this->dut->addCategoryOfRecipe(2345, 'Main dishes', $this->user); + $this->dut->addCategoryOfRecipe(3456, 'Main dishes', $this->user); + $this->dut->addCategoryOfRecipe(6789, 'desert', $this->user); + + $this->dut->addKeywordPairs([ + ['recipeId' => 1234, 'name' => 'Sweet'], + ['recipeId' => 1234, 'name' => 'Foreign'], + ['recipeId' => 1234, 'name' => 'Favorites'], + ['recipeId' => 1234, 'name' => 'Fast'], + + ['recipeId' => 5678, 'name' => 'Vegetarian'], + ['recipeId' => 5678, 'name' => 'Fast'], + + ['recipeId' => 2345, 'name' => 'Beef'], + ['recipeId' => 2345, 'name' => 'Meat'], + + ['recipeId' => 3456, 'name' => 'Chicken'], + ['recipeId' => 3456, 'name' => 'Meat'], + ['recipeId' => 3456, 'name' => 'Favorites'], + + // Water has no keyword + ], $this->user); + } + + public function testGetKeywords() { + $keywords = $this->dut->findAllKeywords($this->user); + $this->assertEqualsCanonicalizing([ + ['name' => 'Sweet', 'recipeCount' => 1], + ['name' => 'Foreign', 'recipeCount' => 1], + ['name' => 'Favorites', 'recipeCount' => 2], + ['name' => 'Fast', 'recipeCount' => 2], + ['name' => 'Vegetarian', 'recipeCount' => 1], + ['name' => 'Meat', 'recipeCount' => 2], + ['name' => 'Beef', 'recipeCount' => 1], + ['name' => 'Chicken', 'recipeCount' => 1], + ], $keywords); + } + + public function testGetCategories() { + $keywords = $this->dut->findAllCategories($this->user); + $this->assertEqualsCanonicalizing([ + ['name' => 'desert', 'recipeCount' => 2], + ['name' => 'Opener', 'recipeCount' => 1], + ['name' => 'Main dishes', 'recipeCount' => 2], + ['name' => '*', 'recipeCount' => 1], + ], $keywords); + } + + public function testGetRecipesByKeyword() { + if ($_ENV['INPUT_DB'] === 'sqlite') { + $this->markTestSkipped(); + } + + $recipes = $this->dut->getRecipesByKeywords('Favorites', $this->user); + $expected = [ + [ + 'name' => 'Chicken', + 'recipe_id' => 3456, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'keywords' => 'Chicken,Favorites,Meat', + 'category' => 'Main dishes', + ], + [ + 'name' => 'Cooked Bananas', + 'recipe_id' => 1234, + 'dateCreated' => '2022-05-03 14:30:12', + 'dateModified' => null, + 'keywords' => 'Fast,Favorites,Foreign,Sweet', + 'category' => 'desert', + ], + ]; + $this->assertEquals($expected, $recipes); + } + + public function testGetAllRecipesOfCategory() { + $recipes = $this->dut->getRecipesByCategory('desert', $this->user); + $expected = [ + [ + 'name' => 'Cake', + 'recipe_id' => 6789, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'desert', + 'keywords' => null, + ], + [ + 'name' => 'Cooked Bananas', + 'recipe_id' => 1234, + 'dateCreated' => '2022-05-03 14:30:12', + 'dateModified' => null, + 'category' => 'desert', + 'keywords' => 'Fast,Favorites,Foreign,Sweet', + ], + ]; + $this->assertEquals($expected, $recipes); + } + + public function testGetAllRecipesOfEmptyCategory() { + $recipes = $this->dut->getRecipesByCategory('_', $this->user); + $expected = [ + [ + 'name' => 'Water', + 'recipe_id' => 2, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'keywords' => null, + 'category' => null, + ], + ]; + $this->assertEquals($expected, $recipes); + } + + public function testGetNonExistingRecipe() { + $this->expectException(DoesNotExistException::class); + $this->dut->findRecipeById(10); + } + + public function testFindRecipes() { + $recipes = $this->dut->findRecipes(['Desert', 'meat'], $this->user); + $expected = [ + [ + 'name' => 'Cake', + 'recipe_id' => 6789, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'desert', + 'keywords' => null, + ], + [ + 'name' => 'Chicken', + 'recipe_id' => 3456, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'Main dishes', + 'keywords' => 'Chicken,Favorites,Meat', + ], + [ + 'name' => 'Cooked Bananas', + 'recipe_id' => 1234, + 'dateCreated' => '2022-05-03 14:30:12', + 'category' => 'desert', + 'keywords' => 'Fast,Favorites,Foreign,Sweet', + 'dateModified' => null, + ], + [ + 'name' => 'Pulled Beef', + 'recipe_id' => 2345, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'Main dishes', + 'keywords' => 'Beef,Meat', + ], + ]; + $this->assertEquals($expected, $recipes); + } + + public function testDeleteRecipes() { + $this->dut->deleteRecipes([1234, 3456], $this->user); + $expected = [ + [ + 'name' => 'Cake', + 'recipe_id' => 6789, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'desert', + 'keywords' => null, + ], + [ + 'name' => 'Pulled Beef', + 'recipe_id' => 2345, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'Main dishes', + 'keywords' => 'Beef,Meat', + ], + [ + 'name' => 'Salad', + 'recipe_id' => 5678, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => 'Opener', + 'keywords' => 'Fast,Vegetarian', + ], + [ + 'name' => 'Water', + 'recipe_id' => 2, + 'dateCreated' => '2021-06-15 20:10:00', + 'dateModified' => '2021-07-15 14:12:00', + 'category' => null, + 'keywords' => null, + ], + ]; + + $this->assertEquals($expected, $this->dut->findAllRecipes($this->user)); + } + + public function testEmptySearchIndex() { + $this->dut->emptySearchIndex($this->user); + $this->assertEmpty($this->dut->findAllRecipes($this->user)); + $this->assertEmpty($this->dut->findAllKeywords($this->user)); + $expectedCat = [ + ['name' => '*', 'recipe_count' => 0], + ]; + $this->assertEquals($expectedCat, $this->dut->findAllCategories($this->user)); + } +} diff --git a/tests/Integration/Db/RecipeDb/RecipeDbTest.php b/tests/Integration/Db/RecipeDb/RecipeDbTest.php new file mode 100644 index 000000000..055b6ed58 --- /dev/null +++ b/tests/Integration/Db/RecipeDb/RecipeDbTest.php @@ -0,0 +1,209 @@ +dut = $this->query(RecipeDb::class); + } + + public function testBasicCRUD() { + $recipeStub = [ + 'name' => 'My recipe', + 'id' => 1234, + 'dateCreated' => '2022-02-01 15:10:00', + 'dateModified' => '2022-03-05 11:12:34', + ]; + $user = 'test-user'; + + $this->assertEmpty($this->dut->findAllRecipes($user)); + + $this->dut->insertRecipes([$recipeStub], $user); + + $allRecipes = $this->dut->findAllRecipes($user); + + $this->assertEmpty($this->dut->findAllRecipes('some-other-user')); + $this->assertIsArray($allRecipes); + + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => '2022-02-01 15:10:00', + 'dateModified' => '2022-03-05 11:12:34', + 'keywords' => null, + 'category' => null, + ]; + $this->assertEquals($expected, $allRecipes[0]); + + $recipeStub = [ + 'name' => 'My new recipe name', + 'id' => 1234, + 'dateCreated' => '2022-12-11 10:11:12', + 'dateModified' => '2022-09-25 16:17:18', + ]; + + $this->dut->updateRecipes([$recipeStub], $user); + $allRecipes = $this->dut->findAllRecipes($user); + + $expected = [ + 'name' => 'My new recipe name', + 'recipe_id' => 1234, + 'dateCreated' => '2022-12-11 10:11:12', + 'dateModified' => '2022-09-25 16:17:18', + 'keywords' => null, + 'category' => null, + ]; + $this->assertEquals($expected, $allRecipes[0]); + + $expected = [ + 'name' => 'My new recipe name', + 'id' => 1234, + 'dateCreated' => '2022-12-11 10:11:12', + 'dateModified' => '2022-09-25 16:17:18', + // 'keywords' => null, + // 'category' => null, + ]; + $recipe = $this->dut->findRecipeById(1234); + $this->assertEquals($expected, $recipe); + + $this->dut->deleteRecipeById(1234); + $this->assertEmpty($this->dut->findAllRecipes($user)); + } + + public function testEmptyDate() { + $recipeStub = [ + 'name' => 'My recipe', + 'id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + ]; + $user = 'test-user'; + + $this->assertEmpty($this->dut->findAllRecipes($user)); + + $this->dut->insertRecipes([$recipeStub], $user); + + $allRecipes = $this->dut->findAllRecipes($user); + + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + 'keywords' => null, + 'category' => null, + ]; + $this->assertEquals($expected, $allRecipes[0]); + } + + public function testCategoryAddReplace() { + $recipeStub = [ + 'name' => 'My recipe', + 'id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + ]; + $user = 'test-user'; + + $this->assertEmpty($this->dut->findAllRecipes($user)); + $this->dut->insertRecipes([$recipeStub], $user); + + $this->dut->addCategoryOfRecipe(1234, 'my category', $user); + + $recipe = $this->dut->findAllRecipes($user); + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + 'keywords' => null, + 'category' => 'my category', + ]; + $this->assertEquals([$expected], $recipe); + + $this->dut->updateCategoryOfRecipe(1234, 'new category', $user); + + $recipe = $this->dut->findAllRecipes($user); + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + 'keywords' => null, + 'category' => 'new category', + ]; + $this->assertEquals([$expected], $recipe); + + $this->assertEquals('new category', $this->dut->getCategoryOfRecipe(1234, $user)); + + $this->dut->removeCategoryOfRecipe(1234, $user); + $this->assertNull($this->dut->getCategoryOfRecipe(1234, $user)); + } + + public function testKeywordsAddReplace() { + $recipeStub = [ + 'name' => 'My recipe', + 'id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + ]; + $user = 'test-user'; + + $this->assertEmpty($this->dut->findAllRecipes($user)); + $this->dut->insertRecipes([$recipeStub], $user); + + $pairs = [ + ['recipeId' => 1234, 'name' => 'A'], + ['recipeId' => 1234, 'name' => 'B'], + ['recipeId' => 1234, 'name' => 'c'], + ]; + $this->dut->addKeywordPairs($pairs, $user); + + $recipes = $this->dut->findAllRecipes($user); + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + 'keywords' => 'A,B,c', + 'category' => null, + ]; + $this->assertEquals([$expected], $recipes); + + $this->assertEquals(['A', 'B', 'c'], $this->dut->getKeywordsOfRecipe(1234, $user)); + + $pairs = [ + ['recipeId' => 1234, 'name' => 'A'], + ['recipeId' => 1234, 'name' => 'c'], + ]; + $this->dut->removeKeywordPairs($pairs, $user); + + $recipes = $this->dut->findAllRecipes($user); + $expected = [ + 'name' => 'My recipe', + 'recipe_id' => 1234, + 'dateCreated' => null, + 'dateModified' => null, + 'keywords' => 'B', + 'category' => null, + ]; + $this->assertEquals([$expected], $recipes); + } + + public function testEmptyInsert() { + $user = 'test-user'; + $this->dut->insertRecipes([], $user); + $this->assertEmpty($this->dut->findAllRecipes($user)); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index bb43a9236..b9d4dfa04 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,6 +3,7 @@ require_once __DIR__ . '/bootstrap_helper.php'; require_once __DIR__ . '/../../../tests/bootstrap.php'; +require_once __DIR__ . '/../vendor/autoload.php'; // Fix for "Autoload path not allowed: .../cookbook/tests/testcase.php" \OC_App::loadApp('cookbook');