From c5498501d319d7432bc447f892fa95c854589113 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 30 Nov 2017 22:54:13 +0100 Subject: [PATCH 1/6] Minor refactoring --- composer.json | 2 +- src/Configuration/ConnectionConfiguration.php | 1 + tests/Result/Item/SurveySummaryTest.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2bf1df6..c564771 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Client of LimeSurvey API", "type": "library", "license": "MIT", - "version": "0.0.11", + "version": "0.0.12", "authors": [ { "name": "Meritoo", diff --git a/src/Configuration/ConnectionConfiguration.php b/src/Configuration/ConnectionConfiguration.php index 0faa62e..1e40bf0 100644 --- a/src/Configuration/ConnectionConfiguration.php +++ b/src/Configuration/ConnectionConfiguration.php @@ -77,6 +77,7 @@ class ConnectionConfiguration * turned off. * @param bool $verifySslCertificate (optional) If is set to true, the SSL certificate verification is turned * on. Otherwise - turned off. + * @throws InvalidUrlException */ public function __construct($baseUrl, $username, $password, $debugMode = false, $verifySslCertificate = true) { diff --git a/tests/Result/Item/SurveySummaryTest.php b/tests/Result/Item/SurveySummaryTest.php index 07534be..7389f6a 100644 --- a/tests/Result/Item/SurveySummaryTest.php +++ b/tests/Result/Item/SurveySummaryTest.php @@ -32,7 +32,7 @@ class SurveySummaryTest extends BaseTestCase * @param array $rawData Raw data of survey's summary * @dataProvider provideRawData */ - public function testCreateOfTheSurveySummary($rawData) + public function testCreateOfTheSurveySummary(array $rawData) { $processor = new ResultProcessor(); $processed = $processor->process(MethodType::GET_SUMMARY, $rawData); From c47016bdea562045116bd950e90346567f865961 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 30 Nov 2017 23:41:09 +0100 Subject: [PATCH 2/6] Readme - configuration of LimeSurvey --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65fc75e..6eaa012 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,24 @@ Client of the [LimeSurvey's API](https://manual.limesurvey.org/RemoteControl_2_A Run [Composer](https://getcomposer.org) to install this package in your project: - ```bash - $ composer require meritoo/limesurvey-api-client - ``` +```bash +$ composer require meritoo/limesurvey-api-client +``` > How to install Composer: https://getcomposer.org/download +## Configuration of LimeSurvey + +1. Login to the LimeSurvey administration, e.g. using https://your-domain/admin address +2. Go to menu: `Configuration` -> `Global settings` +3. Open `Interfaces` tab +4. For `RPC interface enabled` select `JSON-RPC` option +5. Enable `Publish API on /admin/remotecontrol` option + +It should look like here: +![Configuration of LimeSurvey](http://www.meritoo.pl/packages/github/limesurvey-api-client/readme/configuration-interfaces.png) +More information: https://manual.limesurvey.org/RemoteControl_2_API#Introduction + ## Usage 1. First of all you have to prepare configuration of connection and create instance of a client: From 54bd021649fdfd6fb593061366cf2e90bf21d488 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 6 Sep 2018 23:32:13 +0200 Subject: [PATCH 3/6] Bump version --- VERSION | 1 + composer.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/composer.json b/composer.json index c564771..ccf8db6 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "Client of LimeSurvey API", "type": "library", "license": "MIT", - "version": "0.0.12", "authors": [ { "name": "Meritoo", From 7ef83dac5d7104e0c3aead8922571798991a352c Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 6 Sep 2018 23:32:45 +0200 Subject: [PATCH 4/6] Phing > update XMLs --- .gitignore | 2 +- .phing/app.xml | 89 --------- .phing/tests.xml | 315 ------------------------------ build.xml | 16 +- phing/app.xml | 164 ++++++++++++++++ phing/filesets.xml | 35 ++++ {.phing => phing}/properties.dist | 83 +++----- phing/tests.xml | 230 ++++++++++++++++++++++ 8 files changed, 466 insertions(+), 468 deletions(-) delete mode 100644 .phing/app.xml delete mode 100644 .phing/tests.xml create mode 100644 phing/app.xml create mode 100644 phing/filesets.xml rename {.phing => phing}/properties.dist (58%) create mode 100644 phing/tests.xml diff --git a/.gitignore b/.gitignore index 5a8bdc3..a5199ef 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # ---------------------------------------------------------------------------------------------------------------------- ### Phing # ---------------------------------------------------------------------------------------------------------------------- -/.phing/properties +/phing/properties # ---------------------------------------------------------------------------------------------------------------------- ### PHPUnit diff --git a/.phing/app.xml b/.phing/app.xml deleted file mode 100644 index 028fe2b..0000000 --- a/.phing/app.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.phing/tests.xml b/.phing/tests.xml deleted file mode 100644 index 4567626..0000000 --- a/.phing/tests.xml +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.xml b/build.xml index fccc179..50088c8 100644 --- a/build.xml +++ b/build.xml @@ -2,40 +2,40 @@ - + - + - + + description="Builds everything and runs all tests"/> - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phing/filesets.xml b/phing/filesets.xml new file mode 100644 index 0000000..13dcb7f --- /dev/null +++ b/phing/filesets.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/.phing/properties.dist b/phing/properties.dist similarity index 58% rename from .phing/properties.dist rename to phing/properties.dist index 992dbb6..eb4b0db 100644 --- a/.phing/properties.dist +++ b/phing/properties.dist @@ -9,7 +9,7 @@ # not special chars. This way you can create pseudo-namespaces # # You can refer to values of other properties by enclosing their keys in "${}". -# Example: dir.js = ${dir.web}/js +# Example: dir.js = ${dir.public}/js # # Everything behind the equal sign is the value, you do # not have to enclose strings: text=This is some text, Your OS is ${php.os} @@ -22,13 +22,15 @@ # env = dev -# Install assets using symlinks -# -assets.installWithSymlink = true - # Clear cache with the "warmup" option # -cache.clearWithWarmup = true +# The cache:clear command should always be called with the --no-warmup option. Warmup should be done via the cache:warmup command. +# https://github.com/symfony/symfony/blob/master/UPGRADE-3.3.md#frameworkbundle +# +# Meritoo +# 2017-06-06 +# +cache.clearWithWarmup = false # -------------------------------------------------------------------------------- # Composer @@ -39,7 +41,6 @@ composer.download_command = php -r "eval('?>'.file_get_contents('https://getcomp # Path to composer executable or composer.phar file # composer.path = composer.phar -#composer.path = /usr/local/bin/composer # Path to php executable used by composer # @@ -49,77 +50,49 @@ composer.php = php # composer.self-update = false -# Validate the composer.json file -# -composer.validate = false - # -------------------------------------------------------------------------------- # Directories # -------------------------------------------------------------------------------- # System directories # -dir.data = ${project.basedir}/.data dir.src = ${project.basedir}/src +dir.var = ${project.basedir}/tests/Resources/var +dir.cache = ${dir.var}/cache +dir.logs = ${dir.var}/log +dir.sessions = ${dir.var}/sessions +dir.data = ${project.basedir}/data dir.tests = ${project.basedir}/tests -# -------------------------------------------------------------------------------- # Build directories -# -------------------------------------------------------------------------------- - -dir.build = ${project.basedir}/.build +# +dir.build = ${project.basedir}/build dir.reports = ${dir.build}/logs dir.reports.pdepend = ${dir.reports}/pdepend -dir.reports.coverage = ${dir.reports}/phpunit_coverage -# -# Disabled, because unnecessary right now -# phpdocumentor/phpdocumentor cannot be installed via Composer -# -# Krzysztof Niziol -# 2017-02-22 -# -#dir.docs = ${dir.build}/docs -#dir.docs.phpdoc2 = ${dir.docs}/phpdoc2 -# -------------------------------------------------------------------------------- # Data directories -# -------------------------------------------------------------------------------- - +# dir.data.tests = ${dir.data}/tests dir.data.temporary = ${dir.data}/tmp +# Docker directories +# +dir.docker = ${project.basedir}/docker +dir.docker.data = ${dir.docker}/data/db +dir.docker.logs = ${dir.docker}/logs/nginx + # -------------------------------------------------------------------------------- # Testing # -------------------------------------------------------------------------------- +# Path of the PHP Coding Standards Fixer (http://cs.sensiolabs.org) +# +tests.cs_fixer.path = ./vendor/bin/php-cs-fixer + # Test database path # tests.database = ${dir.data.temporary}/database.sqlite +# Path of the framework used to run unit tests # -# Disabled, because unnecessary right now -# PHPUnit is installed and loaded by Composer -# -# Krzysztof Niziol -# 2017-02-22 -# -# Run PHPUnit using exec task instead of phpunitTask -#phpunit.useExec = false - -# -# Disabled, because unnecessary right now -# We want generate code coverage always -# -# Krzysztof Niziol -# 2017-02-22 -# -# Collect coverage data during tests -#phpunit.withCoverage = true - -# Path of the PHPUnit (https://phpunit.de) -# -phpUnit.path = ./vendor/bin/phpunit - -# Path of the PHP Coding Standards Fixer (http://cs.sensiolabs.org) -# -phpCsFixer.path = ./vendor/bin/php-cs-fixer +tests.framework.path = ./vendor/bin/phpunit --verbose --no-coverage diff --git a/phing/tests.xml b/phing/tests.xml new file mode 100644 index 0000000..398ee31 --- /dev/null +++ b/phing/tests.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 525391083ad7b9267af7c889e0d73129c67a0cbc Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 6 Sep 2018 23:33:23 +0200 Subject: [PATCH 5/6] Docker > update configuration --- .docker/config/Dockerfile | 64 ---------------- .env | 14 ++++ docker-compose.yml | 19 +++-- docker/config/Dockerfile | 103 ++++++++++++++++++++++++++ {.docker => docker}/config/php.ini | 0 {.docker => docker}/config/xdebug.ini | 0 6 files changed, 129 insertions(+), 71 deletions(-) delete mode 100644 .docker/config/Dockerfile create mode 100644 docker/config/Dockerfile rename {.docker => docker}/config/php.ini (100%) rename {.docker => docker}/config/xdebug.ini (100%) diff --git a/.docker/config/Dockerfile b/.docker/config/Dockerfile deleted file mode 100644 index cb2d05c..0000000 --- a/.docker/config/Dockerfile +++ /dev/null @@ -1,64 +0,0 @@ -FROM php:5.6-cli - -# -# Tools & libraries -# -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - vim \ - git \ - zip \ - unzip \ - zlib1g-dev \ - libicu-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# -# PHP extensions -# -RUN docker-php-ext-install \ - zip \ - intl \ - mbstring - -# -# PHP configuration: -# - default configuration -# - timezone -# -COPY php.ini /usr/local/etc/php/php.ini -ARG TIMEZONE -RUN echo "\n""date.timezone = $TIMEZONE""\n" >> /usr/local/etc/php/php.ini - -# -# Xdebug -# -RUN pecl install xdebug \ - && docker-php-ext-enable xdebug -COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - -# -# Phing -# -RUN pear channel-discover pear.phing.info \ - && pear install [--alldeps] phing/phing - -# -# Composer + https://packagist.org/packages/hirak/prestissimo package -# -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ - && php -r "if (hash_file('SHA384', 'composer-setup.php') === \ - '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo \ - 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ - && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ - && php -r "unlink('composer-setup.php');" \ - && composer global require --no-plugins --no-scripts hirak/prestissimo \ - && rm -rf /root/.composer/cache/* - -# -# Bash -# -RUN sed -i 's/^# export/export/g' /root/.bashrc \ - && sed -i 's/^# alias/alias/g' /root/.bashrc \ - && echo "\n"'export PATH=/project/vendor/bin:$PATH'"\n" >> /root/.bashrc diff --git a/.env b/.env index c6eb126..c493cdb 100644 --- a/.env +++ b/.env @@ -1 +1,15 @@ +# ----------------------------------------------------------------------------- +### Docker +# ----------------------------------------------------------------------------- + +# +# All containers +# +DOCKER_CONTAINER_OWNER=meritoo +DOCKER_CONTAINER_PROJECT=limesurvey-api-client + +# +# PHP configuration: +# - timezone +# TIMEZONE=Europe/Warsaw diff --git a/docker-compose.yml b/docker-compose.yml index 050add2..701c8b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,20 @@ version: '3' services: - php-cli: - image: meritoo/limesurvey-api-client - container_name: meritoo-limesurvey-api-client - working_dir: /project + php: + image: ${DOCKER_CONTAINER_OWNER}/${DOCKER_CONTAINER_PROJECT}-php + container_name: ${DOCKER_CONTAINER_OWNER}-${DOCKER_CONTAINER_PROJECT}-php entrypoint: php command: -S 0.0.0.0:9999 build: - context: ./.docker/config + context: ./docker/config args: - - TIMEZONE=$TIMEZONE + - TIMEZONE=${TIMEZONE} volumes: - - .:/project + - .:/project:cached + composer: + image: ${DOCKER_CONTAINER_OWNER}/${DOCKER_CONTAINER_PROJECT}-php + container_name: ${DOCKER_CONTAINER_OWNER}-${DOCKER_CONTAINER_PROJECT}-composer + entrypoint: composer + volumes: + - .:/project:cached diff --git a/docker/config/Dockerfile b/docker/config/Dockerfile new file mode 100644 index 0000000..a9b7873 --- /dev/null +++ b/docker/config/Dockerfile @@ -0,0 +1,103 @@ +FROM php:5.6-cli +MAINTAINER Meritoo + +# +# Tools & libraries +# +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + vim \ + git \ + zip \ + unzip \ + zlib1g-dev \ + libicu-dev \ + && apt-get clean \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + +# +# PHP extensions +# +RUN docker-php-ext-install \ + zip \ + intl \ + mbstring + +# +# PHP extensions (PECL): +# - Xdebug +# +RUN pecl install \ + xdebug-2.5.5 \ + && docker-php-ext-enable \ + xdebug + +COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + +# +# PHP configuration: +# - default configuration +# - timezone +# +COPY php.ini /usr/local/etc/php/php.ini +ARG TIMEZONE +RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \ + && echo ${TIMEZONE} > /etc/timezone \ + && printf '[PHP]\ndate.timezone = "%s"\n' ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini \ + && "date" + +# +# Phing +# +RUN pear channel-discover pear.phing.info \ + && pear install [--alldeps] phing/phing + +# +# Composer - environment variables: +# - disable warning about running commands as root/super user +# - disable automatic clearing of sudo sessions +# +# More: +# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser +# +ENV COMPOSER_ALLOW_SUPERUSER 1 + +# +# Composer + https://packagist.org/packages/hirak/prestissimo package +# +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ + && php -r "if (hash_file('SHA384', 'composer-setup.php') === \ + '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo \ + 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ + && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ + && php -r "unlink('composer-setup.php');" \ + && composer global require \ + --no-plugins \ + --no-scripts \ + --no-progress \ + --no-suggest \ + --no-interaction \ + --prefer-dist \ + --optimize-autoloader \ + --classmap-authoritative \ + hirak/prestissimo \ + && rm -rf ~/.composer/cache/* \ + && composer clear-cache \ + && composer --version + +# +# Bash +# +RUN sed -i 's/^# export/export/g; \ + s/^# alias/alias/g;' ~/.bashrc \ + && echo 'COLUMNS=200'"\n" >> ~/.bashrc + +# +# Use project-related binaries globally +# +ENV PATH="/project/vendor/bin:${PATH}" + +WORKDIR /project diff --git a/.docker/config/php.ini b/docker/config/php.ini similarity index 100% rename from .docker/config/php.ini rename to docker/config/php.ini diff --git a/.docker/config/xdebug.ini b/docker/config/xdebug.ini similarity index 100% rename from .docker/config/xdebug.ini rename to docker/config/xdebug.ini From 2c89bbe5f542e03e0d7044eb791d44fb7c0a49d5 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 6 Sep 2018 23:35:08 +0200 Subject: [PATCH 6/6] Composer > meritoo/common-library package > use latest version --- composer.json | 2 +- src/Base/Result/BaseParticipantsCollection.php | 6 +++--- src/Exception/UnknownMethodException.php | 12 +++++++++--- src/Result/Collection/SurveysSummaries.php | 6 +++--- tests/Exception/UnknownMethodExceptionTest.php | 4 ++-- tests/Resources/var/cache/.gitkeep | 0 tests/Resources/var/log/.gitkeep | 0 tests/Resources/var/sessions/.gitkeep | 0 8 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 tests/Resources/var/cache/.gitkeep create mode 100644 tests/Resources/var/log/.gitkeep create mode 100644 tests/Resources/var/sessions/.gitkeep diff --git a/composer.json b/composer.json index ccf8db6..c1c72b1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": ">=5.6", "fguillot/json-rpc": "^1.2", - "meritoo/common-library": "~0.0.1" + "meritoo/common-library": "^0.1.0" }, "require-dev": { "phpunit/phpunit": "^5.7", diff --git a/src/Base/Result/BaseParticipantsCollection.php b/src/Base/Result/BaseParticipantsCollection.php index 38db099..406f5fc 100644 --- a/src/Base/Result/BaseParticipantsCollection.php +++ b/src/Base/Result/BaseParticipantsCollection.php @@ -18,7 +18,7 @@ abstract class BaseParticipantsCollection extends Collection */ public function add($element, $index = null) { - throw new DisabledMethodException(__METHOD__, 'addParticipant'); + throw DisabledMethodException::create(__METHOD__, 'addParticipant'); } /** @@ -26,7 +26,7 @@ abstract class BaseParticipantsCollection extends Collection */ public function addMultiple($elements, $useIndexes = false) { - throw new DisabledMethodException(__METHOD__, 'addParticipants'); + throw DisabledMethodException::create(__METHOD__, 'addParticipants'); } /** @@ -34,7 +34,7 @@ abstract class BaseParticipantsCollection extends Collection */ public function has($element) { - throw new DisabledMethodException(__METHOD__, 'hasParticipantsOfSurvey'); + throw DisabledMethodException::create(__METHOD__, 'hasParticipantsOfSurvey'); } /** diff --git a/src/Exception/UnknownMethodException.php b/src/Exception/UnknownMethodException.php index a207bd7..8c8391c 100644 --- a/src/Exception/UnknownMethodException.php +++ b/src/Exception/UnknownMethodException.php @@ -20,10 +20,16 @@ use Meritoo\LimeSurvey\ApiClient\Type\MethodType; class UnknownMethodException extends UnknownTypeException { /** - * {@inheritdoc} + * Creates exception + * + * @param string $unknownMethod Name of unknown method used while talking to the LimeSurvey's API + * @return UnknownMethodException */ - public function __construct($unknownType) + public static function createException($unknownMethod) { - parent::__construct($unknownType, new MethodType(), 'name of method used while talking to the LimeSurvey\'s API'); + /* @var UnknownMethodException $exception */ + $exception = parent::create($unknownMethod, new MethodType(), 'name of method used while talking to the LimeSurvey\'s API'); + + return $exception; } } diff --git a/src/Result/Collection/SurveysSummaries.php b/src/Result/Collection/SurveysSummaries.php index 91d66c6..e41cf8c 100644 --- a/src/Result/Collection/SurveysSummaries.php +++ b/src/Result/Collection/SurveysSummaries.php @@ -25,7 +25,7 @@ class SurveysSummaries extends Collection */ public function add($element, $index = null) { - throw new DisabledMethodException(__METHOD__, 'addSurveySummary'); + throw DisabledMethodException::create(__METHOD__, 'addSurveySummary'); } /** @@ -33,7 +33,7 @@ class SurveysSummaries extends Collection */ public function addMultiple($elements, $useIndexes = false) { - throw new DisabledMethodException(__METHOD__, 'addSurveysSummaries'); + throw DisabledMethodException::create(__METHOD__, 'addSurveysSummaries'); } /** @@ -41,7 +41,7 @@ class SurveysSummaries extends Collection */ public function has($element) { - throw new DisabledMethodException(__METHOD__, 'hasSurveySummary'); + throw DisabledMethodException::create(__METHOD__, 'hasSurveySummary'); } /** diff --git a/tests/Exception/UnknownMethodExceptionTest.php b/tests/Exception/UnknownMethodExceptionTest.php index 681bcfb..a56979d 100644 --- a/tests/Exception/UnknownMethodExceptionTest.php +++ b/tests/Exception/UnknownMethodExceptionTest.php @@ -24,7 +24,7 @@ class UnknownMethodExceptionTest extends BaseTestCase { public function testConstructorVisibilityAndArguments() { - static::assertConstructorVisibilityAndArguments(UnknownMethodException::class, OopVisibilityType::IS_PUBLIC, 1, 1); + static::assertConstructorVisibilityAndArguments(UnknownMethodException::class, OopVisibilityType::IS_PUBLIC, 3); } /** @@ -35,7 +35,7 @@ class UnknownMethodExceptionTest extends BaseTestCase */ public function testConstructorMessage($unknownType, $expectedMessage) { - $exception = new UnknownMethodException($unknownType); + $exception = UnknownMethodException::createException($unknownType); static::assertEquals($expectedMessage, $exception->getMessage()); } diff --git a/tests/Resources/var/cache/.gitkeep b/tests/Resources/var/cache/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/Resources/var/log/.gitkeep b/tests/Resources/var/log/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/Resources/var/sessions/.gitkeep b/tests/Resources/var/sessions/.gitkeep new file mode 100644 index 0000000..e69de29