diff --git a/Examples/assets/blueblack400x300grad.png b/Examples/assets/blueblack400x300grad.png old mode 100644 new mode 100755 diff --git a/Examples/assets/classroom.jpg b/Examples/assets/classroom.jpg old mode 100644 new mode 100755 diff --git a/Examples/assets/dataset01.inc.php b/Examples/assets/dataset01.inc.php old mode 100644 new mode 100755 index 3a1d2b7a..ff74219b --- a/Examples/assets/dataset01.inc.php +++ b/Examples/assets/dataset01.inc.php @@ -1,7 +1,7 @@ /dev/null) -HASPHPMD := $(shell command -v phpmd 2> /dev/null) - +XDSWI_STATUS:=$(shell command xd_swi stat 2> /dev/null) +CURRENT_FOLDER:=$(shell command pwd 2> /dev/null) +HAS_PHPMD := $(shell command -v phpmd 2> /dev/null) +HAS_CSFIXER:= $(shell command -v php-cs-fixer 2> /dev/null) +HAS_PSALM:=$(shell command -v psalm stat 2> /dev/null) +HAS_PHPCPD:=$(shell command -v phpcpd 2> /dev/null) YELLOW=\033[0;33m RED=\033[0;31m -WHITE=\033[0m +WHITE=\033[1m +RESET=\033[0m GREEN=\u001B[32m ifneq ($(g),) groups=-g endif - +ifeq ($(target),) + target=src +endif default: clean .PHONY: version install test tag start csfixer @@ -26,10 +33,22 @@ install: composer install --no-dev test: - php vendor/bin/codecept run unit $(test) $(groups) $(g) --debug + @if [[ "$(XDSWI)" != "" ]]; then \ + echo -e "$(WHITE)XDebug state is$(RESET) $(XDSWI_STATUS)" ;\ + fi ;\ + xd_swi off ;\ + php vendor/bin/codecept run unit $(test) $(groups) $(g) --debug ;\ + echo seting XDebug to initial state $(XDSWI_STATUS) ;\ + xd_swi $(XDSWI_STATUS) test_coverage: - php vendor/bin/codecept run unit $(test) -g ready --coverage --coverage-xml + @if [[ "$(XDSWI)" != "" ]]; then \ + echo -e "$(WHITE)XDebug state is$(RESET) $(XDSWI_STATUS)" ;\ + fi ;\ + xd_swi on ;\ + php vendor/bin/codecept run unit $(test) --coverage-html ;\ + echo seting XDebug to initial state $(XDSWI_STATUS) ;\ + xd_swi $(XDSWI_STATUS) update_version: @echo "Current version is " ${VERSION} @@ -45,7 +64,7 @@ tag_and_push: git push git push --tags -tag: update_version csfixer tag_and_push +tag: test update_version csfixer tag_and_push delete_tag: git tag -d $(v) @@ -55,10 +74,11 @@ start: php -S localhost:8000 -t Examples runcsfixer: - @if [ -f ./vendor/bin/php-cs-fixer ]; then \ - ./vendor/bin/php-cs-fixer --verbose fix ;\ + @if [[ "$(HAS_CSFIXER)" == "" ]]; then \ + echo -e "$(GREEN)php-cs-fixer$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ + echo -e "Install it with $(GREEN)phive install php-cs-fixer$(WHITE)" ;\ else \ - echo -e "$(GREEN)php-cs-fixer$(WHITE) is $(RED)NOT$(WHITE) installed. Install it with $(GREEN)composer require --dev friendsofphp/php-cs-fixer$(WHITE)" ;\ + php-cs-fixer --verbose fix --using-cache no;\ fi csfixer: @@ -67,6 +87,23 @@ csfixer: else \ xd_swi off ;\ ${MAKE} runcsfixer --no-print-directory ;\ - xd_swi on ;\ + xd_swi $(XDSWI_STATUS) ;\ fi - \ No newline at end of file + +phpmd: + @if [ "$(HAS_PHPMD)" == "" ]; then \ + echo -e "$(GREEN)phpmd$(WHITE) is $(RED)NOT$(WHITE) installed. " ;\ + echo -e "Install it with $(GREEN)phive install phpmd$(WHITE)" ;\ + else \ + phpmd src text .phpmd.xml | sed "s/.*\///" ;\ + fi ;\ + echo "" + + +phpcpd: + @if ["$(HAS_PHPCPD)" == "" ]; then \ + echo -e "$(GREEN)phpcpd$(WHITE) is $(RED)NOT$(WHITE) installed. Install it with $(GREEN)phive install phpcpd$(WHITE)" ;\ + else \ + phpcpd --fuzzy --ansi --log-pmd=.pmd.log $(target) ;\ + fi ;\ + echo "" \ No newline at end of file diff --git a/codeception.yml b/codeception.yml index fa3296c3..6f081484 100644 --- a/codeception.yml +++ b/codeception.yml @@ -1,64 +1,26 @@ -paths: - tests: tests - output: tests/_output - data: tests/_data - support: tests/_support - envs: tests/_envs -actor_suffix: Tester -extensions: - enabled: - - Codeception\Extension\RunFailed - - Codeception\Extension\Logger -coverage: - enabled: true - include: - - src/* - -settings: - - # name of bootstrap that will be used - # each bootstrap file should be - # inside a suite directory. - bootstrap: _bootstrap.php +namespace: Amenadiel\JpGraph\UnitTest +suites: + unit: + path: . +bootstrap: _bootstrap.php - # enable/disable syntax of test files before loading - # for php < 7 exec('php -l') is used - # disable if you need to speed up tests execution - lint: true - - # randomize test order - shuffle: false +settings: + shuffle: true + lint: true - # by default it's false on Windows - # use [ANSICON](https://github.com/adoxa/ansicon) to colorize output. - colors: true +paths: + tests: tests + output: tests/_output + support: tests/_support + data: tests - # Generate XML JUnit report using strict schema - # Avoid putting additional report fields like steps or scenario names tot it - # Required for XML reports on Jenkins CI - strict_xml: false +coverage: + enabled: true + include: + - src/*.php + exclude: + - src/flags/* + - src/lang/* + - src/fonts/* + - src/includes/* - # Tests (especially functional) can take a lot of memory - # We set a high limit for them by default. - memory_limit: 1024M - - # This value controls whether PHPUnit attempts to backup global variables - # See https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobals - backup_globals: true - - # PHPUnit can be strict about tests that do not test anything - # See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.useless-tests - report_useless_tests: false - - # PHPUnit can be strict about output during tests. - # See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.output-during-test-execution - disallow_test_output: false - - # PHPUnit can be strict about tests that manipulate global state. - # See https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.global-state-manipulation - be_strict_about_changes_to_global_state: false - - # Log the incomplete and skipped tests into junit report - # See https://phpunit.de/manual/current/en/appendixes.configuration.html - # Section logging > junit - log_incomplete_skipped: false \ No newline at end of file diff --git a/composer.json b/composer.json index 2f727d21..b019c609 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "codeception/codeception": "^4.0", "codeception/module-asserts": "^1.1", "squizlabs/php_codesniffer": "^3.5", - "symfony/dotenv": "~4.2.0" + "symfony/dotenv": "~4.2.0", + "monolog/monolog": "^2.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 43781630..ad389f05 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "baf2e2dd7328f74e92fa6810c16b541d", + "content-hash": "0866d938af2c10b4846616943ce9402e", "packages": [], "packages-dev": [ { @@ -519,6 +519,87 @@ ], "time": "2019-10-17T18:05:24+00:00" }, + { + "name": "monolog/monolog", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c861fcba2ca29404dc9e617eedd9eff4616986b8", + "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8", + "shasum": "" + }, + "require": { + "php": "^7.2", + "psr/log": "^1.0.1" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^6.0", + "graylog2/gelf-php": "^1.4.2", + "jakub-onderka/php-parallel-lint": "^0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpunit/phpunit": "^8.3", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90 <3.0", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2019-12-20T14:22:59+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.9.4", @@ -1363,6 +1444,53 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/log", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "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": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2019-11-01T11:05:21+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", diff --git a/src/config.inc.php b/src/config.inc.php index 3ce373b2..87c1c156 100644 --- a/src/config.inc.php +++ b/src/config.inc.php @@ -1,7 +1,7 @@ ,) diff --git a/src/lang/en.inc.php b/src/lang/en.inc.php index 1e9cce59..17094b2b 100644 --- a/src/lang/en.inc.php +++ b/src/lang/en.inc.php @@ -1,7 +1,7 @@ ,) diff --git a/src/lang/prod.inc.php b/src/lang/prod.inc.php index e48cfbc9..c73fdf48 100644 --- a/src/lang/prod.inc.php +++ b/src/lang/prod.inc.php @@ -1,7 +1,7 @@ filledAreas[$i][0] * $factor, ($this->filledAreas[$i][1] - $this->filledAreas[$i][0] + ($this->step_style ? 0 : 1)) * $factor ) - ); + ); $areaCoords[] = $areaCoords[safe_count($areaCoords) - 2]; // last x $areaCoords[] = $minY; // last y diff --git a/src/plot/MeshInterpolate.php b/src/plot/MeshInterpolate.php index dbf6a745..a5c8a6ea 100644 --- a/src/plot/MeshInterpolate.php +++ b/src/plot/MeshInterpolate.php @@ -1,7 +1,7 @@ traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testLabelBackground() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testDuplicatingYAxis() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testUsingMultipleYAxis() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + + } +} diff --git a/tests/BackgroundTest.php b/tests/BackgroundTest.php new file mode 100644 index 00000000..12614358 --- /dev/null +++ b/tests/BackgroundTest.php @@ -0,0 +1,70 @@ + [ + + 'background_type_ex0.php', + 'background_type_ex1.php', + 'background_type_ex2.php', + 'background_type_ex3.php', + 'background_type_ex4.php', + + ], + 'testBackgroundImage' => [ + 'backgroundex01.php', + 'backgroundex02.php', + 'backgroundex03.php', + ], + + ]; + public static $files = null; + public static $exampleRoot = null; + public static $ranTests = []; + + public static function setUpBeforeClass(): void + { + $className = str_replace('test', '', strtolower(__CLASS__)); + + self::$files = self::getFiles($className); + $knownFixtures = self::getShallowFixtureArray(self::$fixTures); + + self::$files = array_filter(self::$files, function ($filename) use ($knownFixtures) { + return !array_key_exists($filename, $knownFixtures); + }); + + Debug::debug(__CLASS__ . ' has ' . count(self::$files) . ' files'); + + } + + protected function _before() {} + + protected function _after() {} + + public function testUsingBackgroundImage() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testBackgroundImage() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/BarTest.php b/tests/BarTest.php new file mode 100644 index 00000000..e94f0e19 --- /dev/null +++ b/tests/BarTest.php @@ -0,0 +1,77 @@ +traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testExampleWith2ScaleBars() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testBarPattern() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGroupedAccumulatedBarPlots() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testExample() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testAdjustingTheWidth() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testAccumulatedBarPlots() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradMidver() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradMidhor() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradHor() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradVer() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradWideMidver() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradWideMidhor() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradCenter() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testGradRaisedPanel() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testAddingalineplottoabargraph() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testBand3dplane() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/CanvasTest.php b/tests/CanvasTest.php new file mode 100644 index 00000000..e982ae8c --- /dev/null +++ b/tests/CanvasTest.php @@ -0,0 +1,63 @@ +_fileCheck($file, $carry); + return $carry; + }, []); + } + + public function testBezierLineWithControlPoints() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testCanvasSpiral() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testGenerateGradientBackground() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testFontDemonstrationOnCanvas() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testtextWithSeveralLines() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testThisIsATextWithMoreText() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } +} diff --git a/tests/ContourTest.php b/tests/ContourTest.php new file mode 100644 index 00000000..1013785f --- /dev/null +++ b/tests/ContourTest.php @@ -0,0 +1,42 @@ +_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/DateTest.php b/tests/DateTest.php new file mode 100644 index 00000000..53c93336 --- /dev/null +++ b/tests/DateTest.php @@ -0,0 +1,54 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testCurrentBids() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testDevelopmentSince() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testAccumulatedValuesWithSpecifiedXAxisScale() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/GanttTest.php b/tests/GanttTest.php new file mode 100644 index 00000000..2fc79f49 --- /dev/null +++ b/tests/GanttTest.php @@ -0,0 +1,82 @@ +assertEquals('image/png', $size['mime'], 'image should have mime image/png for ' . $filename); + + return $this->_normalizeTestGroup($filename, $ownFixtures, $example_title, $debug); + } + + public function testExampleWithGroupingAndConstrains() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function test200() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOfHoursInScale() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function test271() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testGanttChartWithTitleColumnsAndIcons() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testOnlyMonthYearScale() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testAddingASpaningTitle() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleWithMultipleConstrains() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/GeneralTest.php b/tests/GeneralTest.php new file mode 100644 index 00000000..a2ea8663 --- /dev/null +++ b/tests/GeneralTest.php @@ -0,0 +1,42 @@ +_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/ImgTest.php b/tests/ImgTest.php new file mode 100644 index 00000000..b66b7369 --- /dev/null +++ b/tests/ImgTest.php @@ -0,0 +1,117 @@ + [ + 'antispamex01.php', + 'imgmarkerex1.php'], + 'testUsingACountryFlagBackground' => [ + 'bkgimgflagex1.php', + ], + + 'testVerticallySkewedImages' => [ + + // 'bkgimgflagex2.php' => ['width' => 300, 'height' => 53, 'filename' => 'bkgimgflagex2.php'], + // 'bkgimgflagex3.php' => ['width' => 300, 'height' => 53, 'filename' => 'bkgimgflagex3.php'], + ], + + 'testHorizontallySkewedImages' => [ + // 'bkgimgflagex4.php' => ['width' => 170, 'height' => 200, 'filename' => 'bkgimgflagex4.php'], + // 'bkgimgflagex5.php' => ['width' => 170, 'height' => 200, 'filename' => 'bkgimgflagex5.php'], + ], + + ]; + public static $files = null; + public static $exampleRoot = null; + public static $ranTests = []; + + public static function setUpBeforeClass(): void + { + $className = str_replace('test', '', strtolower(__CLASS__)); + + self::$files = self::getFiles($className); + $knownFixtures = self::getShallowFixtureArray(self::$fixTures); + //Debug::debug($knownFixtures); + self::$files = array_filter(self::$files, function ($filename) use ($knownFixtures) { + return !array_key_exists($filename, $knownFixtures); + }); + + // Debug::debug(__CLASS__ . ' has ' . count(self::$files) . ' files'); + + } + + protected function _before() {} + + protected function _after() {} + + public function testHorizontallySkewedImages() + { + foreach (self::$fixTures['testHorizontallySkewedImages'] as $file => $dims) { + + $this->_fileCheck($file, self::$ranTests, false, $dims); + } + } + + public function testUsingACountryFlagBackground() + { + foreach (self::$fixTures['testUsingACountryFlagBackground'] as $file) { + $this->_fileCheck($file, self::$ranTests, false); + } + } + + public function testVerticallySkewedImages() + { + foreach (self::$fixTures['testVerticallySkewedImages'] as $file => $dims) { + + $this->_fileCheck($file, self::$ranTests, false, $dims); + } + } + + private function _fileCheck($filename, &$ownFixtures = [], $debug = false, $dims = []) + { + + $example_title = 'file_iterator'; + ob_start(); + + include self::$exampleRoot . $filename; + + $img = (ob_get_clean()); + $size = getimagesizefromstring($img); + + $size['filename'] = $filename; + if (array_key_exists('width', $dims) && array_key_exists('height', $dims)) { + $__width = $dims['width']; + $__height = $dims['height']; + } + + if (!isset($__width) || !isset($__height)) { + Debug::debug( + 'testing ' . $filename . + ' for image/jpeg headers '); + $this->assertEquals('image/jpeg', $size['mime'], 'image should have mime image/jpeg for ' . $filename); + } else { + Debug::debug( + 'testing ' . $filename . + ' for dims ' . implode('x', [$__width, $__height])); + $this->assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); + $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); + } + return $this->_normalizeTestGroup($filename, $ownFixtures, $example_title, $debug); + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$fixTures['testfileIterator'], function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + + } +} diff --git a/tests/LineTest.php b/tests/LineTest.php new file mode 100644 index 00000000..ffc8fe01 --- /dev/null +++ b/tests/LineTest.php @@ -0,0 +1,171 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBuiltinplotmarksfileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testCashFlow() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testCenterTheLinePointsInBars() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testCombinedBarAndLinePlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testEducationGrowth() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOf10TopBottomGrace() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOfFilledLineCenteredPlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOfFilledLinePlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOfLineCenteredPlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOnTimestampCallback() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleSlantedXLabels() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFilledLineWithNullValues() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFilledYGrid() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFuncfileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFunctionPlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFunctionPlotWithMarker() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testGradbkgfileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testGradientFilledLinePlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testLeftAlignedBars() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testLinebarfileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testLinlogfileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testManualScale() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testNaturalCubicSplines() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testNullvaluefileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testPartiallyfilledlinefileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testStepStyledExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testTabtitlefileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testTheTitle() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/PieTest.php b/tests/PieTest.php new file mode 100644 index 00000000..1bfb505f --- /dev/null +++ b/tests/PieTest.php @@ -0,0 +1,91 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testPiePlotExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExample5OfPiePlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testPiePlotWithAbsoluteLabels() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testLabelGuideLines() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testStringLabelsWithValues() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testpie3dFileIterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExampleOfPiePlotWithAbsoluteLabels() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testPiefileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testpielabelsFileIterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function test200() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testExample4OfPiePlot() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testWithHidden0Labels() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry, true); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/RotateTest.php b/tests/RotateTest.php new file mode 100644 index 00000000..0e916831 --- /dev/null +++ b/tests/RotateTest.php @@ -0,0 +1,42 @@ +_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/ScatterTest.php b/tests/ScatterTest.php new file mode 100644 index 00000000..dd0921b6 --- /dev/null +++ b/tests/ScatterTest.php @@ -0,0 +1,42 @@ +_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/StaticbandTest.php b/tests/StaticbandTest.php new file mode 100644 index 00000000..63b44b5a --- /dev/null +++ b/tests/StaticbandTest.php @@ -0,0 +1,78 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandDiagcross() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandLdiag() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandSolid() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandHvcross() + { + + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandVline() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBandHline() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testBand3dplane() + { + + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testCashFlow() + { + + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + } + + public function testFileIterator() + { + self::$genericFixtures = + array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/ThemeTest.php b/tests/ThemeTest.php new file mode 100644 index 00000000..086310a0 --- /dev/null +++ b/tests/ThemeTest.php @@ -0,0 +1,102 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testGreenthemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testOceanthemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testOrangethemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testPastelthemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testRosethemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testSoftythemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testThemefileiterator() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testUniversalthemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testVividthemeExample() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/TickTest.php b/tests/TickTest.php new file mode 100644 index 00000000..990b4b1a --- /dev/null +++ b/tests/TickTest.php @@ -0,0 +1,48 @@ +traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + protected function _before() {} + + protected function _after() {} + + public function testFileIterator() + { + self::$genericFixtures = array_reduce(self::$files, function ($carry, $file) { + $carry = $this->_fileCheck($file, $carry/*, true*/); + return $carry; + }, self::$genericFixtures); + } +} diff --git a/tests/UnitTestTrait.php b/tests/UnitTestTrait.php new file mode 100644 index 00000000..ea567988 --- /dev/null +++ b/tests/UnitTestTrait.php @@ -0,0 +1,251 @@ +_fileCheck($file, $carry); + return $carry; + }, self::$genericFixtures); + } + + public static function getFiles($class = '') + { + $arr = explode('\\', static::class); + $className = array_pop($arr); + + $folder = self::getRoot($className); + + $d = @dir($folder); + $a = []; + while ($entry = $d->Read()) { + if (is_file($folder . $entry) && + strstr($entry, '.php') && + strstr($entry, 'ex') + && !strstr($entry, 'no_test') + && !strstr($entry, 'no_dim')) { + $a[] = $entry; + } + } + $d->Close(); + if (count($a) == 0) { + die("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: {$folder}"); + } + sort($a); + + return $a; + } + + public static function setUpBeforeClass(): void + { + $arr = explode('\\', static::class); + $className = array_pop($arr); + + $knownFixtures = []; + self::$files = self::getFiles(strtolower($className)); + try { + self::$fixTures = Yaml::parseFile(sprintf('%s/_support/%s.yml', __DIR__, $className)); + + } catch (ParseException $exception) { + printf('Unable to parse the YAML string: %s', $exception->getMessage()); + } + if (is_array(self::$fixTures)) { + $knownFixtures = self::getShallowFixtureArray(self::$fixTures); + } else { + self::$fixTures = ['testFileIterator' => self::$files]; + } + self::$files = array_filter(self::$files, function ($filename) use ($knownFixtures) { + return !array_key_exists($filename, $knownFixtures) || + ( + array_key_exists('testFileIterator', self::$fixTures) && + array_key_exists($filename, self::$fixTures['testFileIterator']) + ); + }); + Debug::debug(__CLASS__ . ' has ' . count(self::$files) . ' ungrouped files. knownFixtures are:'); + Debug::debug($knownFixtures); + + } + + public static function tearDownAfterClass(): void + { + $arr = explode('\\', static::class); + $className = array_pop($arr); + if (count(self::$genericFixtures) > 0) { + if (isset(self::$debugFileGroups) && self::$debugFileGroups && array_key_exists('testFileIterator', self::$genericFixtures)) { + Debug::debug('non grouped fixtures:'); + Debug::debug(self::$genericFixtures['testFileIterator']); + } + $yaml = Yaml::dump(self::$genericFixtures); + if (self::$persistYaml) { + + file_put_contents(sprintf('%s/_support/%s.yml', __DIR__, $className), $yaml); + } + fwrite(STDOUT, $className . "\n"); + } + } + + public static function getRoot($class) + { + if (!self::$exampleRoot) { + self::$exampleRoot = UNIT_TEST_FOLDER . '/Examples/examples_' . str_replace('test', '', strtolower($class)) . '/'; + + } + return self::$exampleRoot; + + } + + public static function getShallowFixtureArray($fixTureArray) + { + return array_reduce(array_keys($fixTureArray), function ($fixTures, $testName) use ($fixTureArray) { + $filenames = $fixTureArray[$testName]; + + $fixTures = array_reduce($filenames, function ($carry, $fixture) use ($testName) { + + if (is_string($fixture)) { + $carry[$fixture] = $testName; + } elseif (is_array($fixture) && array_key_exists('filename', $fixture)) { + // ['filename'=>,'width'=>x, etc etc] + $carry[$fixture['filename']] = $testName; + } + return $carry; + }, $fixTures); + return $fixTures; + }, []); + } + +/** + * Check graph size against declared size. If it doesn't match, rename it. + * + * @param string $exampleRoot The example root folder + * @param $filename The example filename + * @param $__width The declared width + * @param $__height The declared height + * @param $size The actual size + * + * @return boolean true if file was renamed. False otherwise + */ + public static function renameIfDimensionsDontMatch($exampleRoot, $filename, $__width, $__height, $size) + { + if ($__width != $size[0] || $__height != $size[1]) { + rename($exampleRoot . $filename, $exampleRoot . 'no_dim_' . $filename); + return true; + } + return false; + } + + public static function camelCase($inputText) + { + $tofind = 'ÀÁÂÄÅàáâäÒÓÔÖòóôöÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ'; + $replac = 'AAAAAaaaaOOOOooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn'; + + $campo_sanitizado = utf8_encode(strtr(utf8_decode($inputText), utf8_decode($tofind), $replac)); + + $inputText = strtolower(str_replace('%', '_', $campo_sanitizado)); + $inputText = preg_replace('/[^(\x20-\x7F)]*/', '', $inputText); + $inputText = explode(',', $inputText)[0]; + $inputText = preg_replace_callback('/[^a-zA-Z0-9]+([a-zA-Z0-9]+)/', function ($coincidencias) { + $fixed = ucfirst(trim(strtolower($coincidencias[1]))); + $coincidencias[] = $fixed; + return $fixed; + }, strtolower(trim($inputText))); + + return $inputText; + + } + + private function _normalizeTestGroup($filename, &$ownFixtures = [], $example_title = 'file_iterator', $debug = false, $attributes = []) + { + $filename_meaningful = explode('ex', $filename)[0]; + + if ($example_title === 'file_iterator') { + $example_title = self::camelCase(sprintf('%s_%s', $filename_meaningful, $example_title)); + } + $camelCased = self::camelCase($example_title); + $test_title = $camelCased; + $withoutSuffix = preg_match('/(\w(\s|\w)+\w)\s*(?:(ex|v))?\s*([\.\d]+)$/iU', $test_title, $matches); + if ($matches) { + + $test_title = self::camelCase($matches[1]); + } + + $methodName = trim(sprintf('test%s', ucfirst($test_title))); + $matches = null; + + if ($debug) { + Debug::debug([ + 'withoutSuffix' => $withoutSuffix, + 'example_title' => $example_title === 'file_iterator' ? 'No Title' : $example_title, + 'camelCased' => $camelCased, + 'filename' => $filename, + ]); + } + if (!array_key_exists($methodName, $ownFixtures)) { + $ownFixtures[$methodName] = []; + } + $dims = []; + if (array_key_exists('mime', $attributes)) { + $dims = ['width' => $attributes[0], 'height' => $attributes[1]]; + } + $ownFixtures[$methodName][$filename] = array_merge($dims, ['title' => $example_title, 'filename' => $filename]); + return $ownFixtures; + } + + private function _fileCheck($filename, &$ownFixtures = [], $debug = false) + { + if (is_array($filename)) { + if (array_key_exists('width', $filename)) { + $__width = $filename['width']; + } + if (array_key_exists('height', $filename)) { + $__height = $filename['height']; + } + $filename = $filename['filename']; + } + $example_title = 'file_iterator'; + $subtitle_text = ''; + ob_start(); + + include self::$exampleRoot . $filename; + + $img = (ob_get_clean()); + $size = getimagesizefromstring($img); + + $size['filename'] = $filename; + if ($example_title === 'file_iterator' && $subtitle_text) { + $example_title = $subtitle_text; + } + + if (isset($__width) && isset($__height)) { + + self::renameIfDimensionsDontMatch(self::$exampleRoot, $filename, $__width, $__height, $size); + $this->assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); + $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); + } else { + Debug::debug( + 'testing ' . $filename . + ' for image/jpeg headers '); + //$this->assertEquals('image/jpeg', $size['mime'], 'image should have mime image/jpeg for ' . $filename); + } + return $this->_normalizeTestGroup($filename, $ownFixtures, $example_title, $debug, $size); + } +}; diff --git a/tests/WindroseTest.php b/tests/WindroseTest.php new file mode 100644 index 00000000..d05efbf7 --- /dev/null +++ b/tests/WindroseTest.php @@ -0,0 +1,71 @@ +_fileCheck($file, $carry/*, true*/); + return $carry; + }, self::$genericFixtures); + } + + public function testTwoWindrosePlotsInOneGraph() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testExampleWithBackgroundFlag() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testABasicWindroseGraph() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testWindroseExample1b() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testJapaneseLocale() + { + $this->traverseFixtureGroup($this->fixTures(__METHOD__)); + + } + + public function testMultiplePlotsInTheSameGraph() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testFreeTypePlot() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testWindroseexample() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} + + public function testAddingLabelBackgrounds() + {$this->traverseFixtureGroup($this->fixTures(__METHOD__));} +} diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php new file mode 100644 index 00000000..5a8a3388 --- /dev/null +++ b/tests/_bootstrap.php @@ -0,0 +1,12 @@ +exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_MatrixTest.xphp b/tests/_not_ready_MatrixTest.xphp similarity index 88% rename from tests/unit/_not_ready_MatrixTest.xphp rename to tests/_not_ready_MatrixTest.xphp index 4ae841d3..1a1dba89 100644 --- a/tests/unit/_not_ready_MatrixTest.xphp +++ b/tests/_not_ready_MatrixTest.xphp @@ -20,12 +20,12 @@ class MatrixTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_MultigraphTest.xphp b/tests/_not_ready_MultigraphTest.xphp similarity index 88% rename from tests/unit/_not_ready_MultigraphTest.xphp rename to tests/_not_ready_MultigraphTest.xphp index 402627ab..ff6cd4c1 100644 --- a/tests/unit/_not_ready_MultigraphTest.xphp +++ b/tests/_not_ready_MultigraphTest.xphp @@ -20,12 +20,12 @@ class MultigraphTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_OdometerTest.xphp b/tests/_not_ready_OdometerTest.xphp similarity index 88% rename from tests/unit/_not_ready_OdometerTest.xphp rename to tests/_not_ready_OdometerTest.xphp index 43d0ad55..51a70d2c 100644 --- a/tests/unit/_not_ready_OdometerTest.xphp +++ b/tests/_not_ready_OdometerTest.xphp @@ -20,12 +20,12 @@ class OdometerTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_PdfTest.xphp b/tests/_not_ready_PdfTest.xphp similarity index 88% rename from tests/unit/_not_ready_PdfTest.xphp rename to tests/_not_ready_PdfTest.xphp index 9b1d9def..6f6111f9 100644 --- a/tests/unit/_not_ready_PdfTest.xphp +++ b/tests/_not_ready_PdfTest.xphp @@ -20,12 +20,12 @@ class PdfTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_PolarTest.xphp b/tests/_not_ready_PolarTest.xphp similarity index 93% rename from tests/unit/_not_ready_PolarTest.xphp rename to tests/_not_ready_PolarTest.xphp index 99a7d231..f7fc85ad 100644 --- a/tests/unit/_not_ready_PolarTest.xphp +++ b/tests/_not_ready_PolarTest.xphp @@ -25,7 +25,7 @@ class PolarTest extends \Codeception\Test\Unit public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_QrTest.xphp b/tests/_not_ready_QrTest.xphp similarity index 88% rename from tests/unit/_not_ready_QrTest.xphp rename to tests/_not_ready_QrTest.xphp index 9fc99224..e0989f85 100644 --- a/tests/unit/_not_ready_QrTest.xphp +++ b/tests/_not_ready_QrTest.xphp @@ -18,12 +18,12 @@ class QrTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_StockTest.xphp b/tests/_not_ready_StockTest.xphp similarity index 88% rename from tests/unit/_not_ready_StockTest.xphp rename to tests/_not_ready_StockTest.xphp index 579b1eb2..ec485a62 100644 --- a/tests/unit/_not_ready_StockTest.xphp +++ b/tests/_not_ready_StockTest.xphp @@ -20,12 +20,12 @@ class StockTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_SunspotTest.xphp b/tests/_not_ready_SunspotTest.xphp similarity index 88% rename from tests/unit/_not_ready_SunspotTest.xphp rename to tests/_not_ready_SunspotTest.xphp index d1f2889d..49c84814 100644 --- a/tests/unit/_not_ready_SunspotTest.xphp +++ b/tests/_not_ready_SunspotTest.xphp @@ -20,12 +20,12 @@ class SunspotTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/unit/_not_ready_TablesTest.xphp b/tests/_not_ready_TablesTest.xphp similarity index 88% rename from tests/unit/_not_ready_TablesTest.xphp rename to tests/_not_ready_TablesTest.xphp index cb8ac350..62bd0e65 100644 --- a/tests/unit/_not_ready_TablesTest.xphp +++ b/tests/_not_ready_TablesTest.xphp @@ -20,12 +20,12 @@ class TablesTest extends \Codeception\Test\Unit include $this->exampleRoot . $filename; $img = (ob_get_clean()); $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); + Debug::debug($size); } public function testFileIterator() { - $files = GetFiles($this->exampleRoot); + $files =self::getFiles($this->exampleRoot); foreach ($files as $file) { $this->_fileCheck($file); } diff --git a/tests/_support/.gitkeep b/tests/_support/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/_support/AxisTest.yml b/tests/_support/AxisTest.yml new file mode 100644 index 00000000..1add18c5 --- /dev/null +++ b/tests/_support/AxisTest.yml @@ -0,0 +1,16 @@ +testAxislabelbkgfileiterator: + axislabelbkgex01.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex01.php } + axislabelbkgex02.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex02.php } + axislabelbkgex03.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex03.php } + axislabelbkgex04.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex04.php } + axislabelbkgex05.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex05.php } + axislabelbkgex06.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex06.php } + axislabelbkgex07.php: { width: 200, height: 150, title: axislabelbkgFileIterator, filename: axislabelbkgex07.php } +testDupyaxisfileiterator: + dupyaxisex1.php: { width: 300, height: 200, title: dupyaxisFileIterator, filename: dupyaxisex1.php } +testMulyaxisfileiterator: + mulyaxisex1.php: { width: 450, height: 250, title: mulyaxisFileIterator, filename: mulyaxisex1.php } +testInyaxisfileiterator: + inyaxisex1.php: { width: 400, height: 300, title: inyaxisFileIterator, filename: inyaxisex1.php } + inyaxisex2.php: { width: 400, height: 300, title: inyaxisFileIterator, filename: inyaxisex2.php } + inyaxisex3.php: { width: 400, height: 300, title: inyaxisFileIterator, filename: inyaxisex3.php } diff --git a/tests/_support/BackgroundTest.yml b/tests/_support/BackgroundTest.yml new file mode 100644 index 00000000..d8f4d929 --- /dev/null +++ b/tests/_support/BackgroundTest.yml @@ -0,0 +1,10 @@ +testBackgroundfileiterator: + backgroundex01.php: { width: 400, height: 200, title: backgroundFileIterator, filename: backgroundex01.php } + backgroundex02.php: { width: 400, height: 200, title: backgroundFileIterator, filename: backgroundex02.php } + backgroundex03.php: { width: 400, height: 200, title: backgroundFileIterator, filename: backgroundex03.php } +testBackgroundtypefileiterator: + background_type_ex0.php: { width: 350, height: 250, title: backgroundTypeFileIterator, filename: background_type_ex0.php } + background_type_ex1.php: { width: 350, height: 250, title: backgroundTypeFileIterator, filename: background_type_ex1.php } + background_type_ex2.php: { width: 350, height: 250, title: backgroundTypeFileIterator, filename: background_type_ex2.php } + background_type_ex3.php: { width: 350, height: 250, title: backgroundTypeFileIterator, filename: background_type_ex3.php } + background_type_ex4.php: { width: 350, height: 250, title: backgroundTypeFileIterator, filename: background_type_ex4.php } diff --git a/tests/_support/BarTest.yml b/tests/_support/BarTest.yml new file mode 100644 index 00000000..c77d9b8b --- /dev/null +++ b/tests/_support/BarTest.yml @@ -0,0 +1,68 @@ +testBargradsmallfileiterator: + bargradsmallex4.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex4.php } + bargradsmallex2.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex2.php } + bargradsmallex6.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex6.php } + bargradsmallex1.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex1.php } + bargradsmallex5.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex5.php } + bargradsmallex7.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex7.php } + bargradsmallex3.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex3.php } + bargradsmallex8.php: { width: 200, height: 150, title: bargradsmallFileIterator, filename: bargradsmallex8.php } +testAccbarframefileiterator: + accbarframeex01.php: { width: 350, height: 250, title: accbarframeFileIterator, filename: accbarframeex01.php } + accbarframeex02.php: { width: 350, height: 250, title: accbarframeFileIterator, filename: accbarframeex02.php } + accbarframeex03.php: { width: 350, height: 250, title: accbarframeFileIterator, filename: accbarframeex03.php } +testBarformatcallbackfileiterator: + barformatcallbackex1.php: { width: 400, height: 300, title: barformatcallbackFileIterator, filename: barformatcallbackex1.php } +testBargradfileiterator: + bargradex1.php: { width: 400, height: 240, title: bargradFileIterator, filename: bargradex1.php } + bargradex2.php: { width: 400, height: 200, title: bargradFileIterator, filename: bargradex2.php } + bargradex3.php: { width: 400, height: 200, title: bargradFileIterator, filename: bargradex3.php } + bargradex4.php: { width: 400, height: 200, title: bargradFileIterator, filename: bargradex4.php } + bargradex5.php: { width: 400, height: 200, title: bargradFileIterator, filename: bargradex5.php } + bargradex6.php: { width: 500, height: 200, title: bargradFileIterator, filename: bargradex6.php } +testBarlinealphafileiterator: + barlinealphaex1.php: { width: 300, height: 200, title: barlinealphaFileIterator, filename: barlinealphaex1.php } +testBarlinefreqfileiterator: + barlinefreqex1.php: { width: 350, height: 250, title: barlinefreqFileIterator, filename: barlinefreqex1.php } +testBartutfileiterator: + bartutex1.php: { width: 300, height: 200, title: bartutFileIterator, filename: bartutex1.php } + bartutex12.php: { width: 450, height: 300, title: bartutFileIterator, filename: bartutex12.php } +testFileiterator: + example18.php: { width: 300, height: 200, title: FileIterator, filename: example18.php } + example19.1.php: { width: 300, height: 200, title: FileIterator, filename: example19.1.php } + example19.php: { width: 300, height: 200, title: FileIterator, filename: example19.php } + example20.1.php: { width: 300, height: 200, title: FileIterator, filename: example20.1.php } + example20.2.php: { width: 300, height: 200, title: FileIterator, filename: example20.2.php } + example20.3.php: { width: 300, height: 200, title: FileIterator, filename: example20.3.php } + example20.4.php: { width: 300, height: 200, title: FileIterator, filename: example20.4.php } + example20.5.php: { width: 300, height: 200, title: FileIterator, filename: example20.5.php } + example20.php: { width: 300, height: 200, title: FileIterator, filename: example20.php } + example25.1.php: { width: 300, height: 200, title: FileIterator, filename: example25.1.php } + example25.2.php: { width: 300, height: 200, title: FileIterator, filename: example25.2.php } + example25.php: { width: 300, height: 200, title: FileIterator, filename: example25.php } + example24.php: { width: 310, height: 200, title: FileIterator, filename: example24.php } + example16.2.php: { width: 400, height: 200, title: FileIterator, filename: example16.2.php } + example16.3.php: { width: 400, height: 200, title: FileIterator, filename: example16.3.php } + example16.4.php: { width: 400, height: 200, title: FileIterator, filename: example16.4.php } + example22.php: { width: 310, height: 200, title: FileIterator, filename: example22.php } + example16.5.php: { width: 350, height: 200, title: FileIterator, filename: example16.5.php } + example21.php: { width: 310, height: 200, title: FileIterator, filename: example21.php } + example23.php: { width: 310, height: 200, title: FileIterator, filename: example23.php } +testHorizbarfileiterator: + horizbarex4.php: { width: 400, height: 500, title: horizbarFileIterator, filename: horizbarex4.php } +testManualtfileiterator: + manual_textscale_ex2.php: { width: 300, height: 200, title: manualTFileIterator, filename: manual_textscale_ex2.php } + manual_textscale_ex3.php: { width: 300, height: 200, title: manualTFileIterator, filename: manual_textscale_ex3.php } + manual_textscale_ex4.php: { width: 400, height: 200, title: manualTFileIterator, filename: manual_textscale_ex4.php } +testBar2scalesfileiterator: + bar2scalesex1.php: { width: 450, height: 200, title: bar2scalesFileIterator, filename: bar2scalesex1.php } +testPlotbanddensityfileiterator: + plotbanddensity_ex0.php: { width: 200, height: 200, title: plotbanddensityFileIterator, filename: plotbanddensity_ex0.php } + plotbanddensity_ex1.php: { width: 200, height: 200, title: plotbanddensityFileIterator, filename: plotbanddensity_ex1.php } + plotbanddensity_ex2.php: { width: 200, height: 200, title: plotbanddensityFileIterator, filename: plotbanddensity_ex2.php } +testAccbarfileiterator: + accbarex1.php: { width: 500, height: 400, title: accbarFileIterator, filename: accbarex1.php } +testNegbarvaluefileiterator: + negbarvalueex01.php: { width: 400, height: 300, title: negbarvalueFileIterator, filename: negbarvalueex01.php } +testBarpatternfileiterator: + barpatternex1.php: { width: 350, height: 300, title: barpatternFileIterator, filename: barpatternex1.php } diff --git a/tests/_support/CanvasTest.yml b/tests/_support/CanvasTest.yml new file mode 100644 index 00000000..99d5954f --- /dev/null +++ b/tests/_support/CanvasTest.yml @@ -0,0 +1,7 @@ +testCanvasbezierfileiterator: + canvasbezierex1.php: { width: 400, height: 300, title: canvasbezierFileIterator, filename: canvasbezierex1.php } +testCanvasfileiterator: + canvasex05.php: { width: 400, height: 200, title: canvasFileIterator, filename: canvasex05.php } + canvasex06.php: { width: 400, height: 200, title: canvasFileIterator, filename: canvasex06.php } +testCanvaspiralfileiterator: + canvaspiralex1.php: { width: 150, height: 240, title: canvaspiralFileIterator, filename: canvaspiralex1.php } diff --git a/tests/_support/ContourTest.yml b/tests/_support/ContourTest.yml new file mode 100644 index 00000000..ed6ff9ff --- /dev/null +++ b/tests/_support/ContourTest.yml @@ -0,0 +1,14 @@ +testBasiccontourfileiterator: + basic_contourex01.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex01.php } + basic_contourex02.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex02.php } + basic_contourex03-1.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex03-1.php } + basic_contourex03-2.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex03-2.php } + basic_contourex03-3.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex03-3.php } + basic_contourex04.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex04.php } + basic_contourex05.php: { width: 350, height: 250, title: basicContourFileIterator, filename: basic_contourex05.php } +testContourfileiterator: + contourex01.php: { width: 500, height: 380, title: contourFileIterator, filename: contourex01.php } + contourex02.php: { width: 500, height: 380, title: contourFileIterator, filename: contourex02.php } + contourex03.php: { width: 500, height: 380, title: contourFileIterator, filename: contourex03.php } + contourex04.php: { width: 500, height: 380, title: contourFileIterator, filename: contourex04.php } + contourex05.php: { width: 480, height: 390, title: contourFileIterator, filename: contourex05.php } diff --git a/tests/_support/DateTest.yml b/tests/_support/DateTest.yml new file mode 100644 index 00000000..099ce682 --- /dev/null +++ b/tests/_support/DateTest.yml @@ -0,0 +1,5 @@ +testDateaxisfileiterator: + dateaxisex1.php: { width: 324, height: 250, title: dateaxisFileIterator, filename: dateaxisex1.php } +testDateutilfileiterator: + dateutilex01.php: { width: 500, height: 300, title: dateutilFileIterator, filename: dateutilex01.php } + dateutilex02.php: { width: 500, height: 300, title: dateutilFileIterator, filename: dateutilex02.php } diff --git a/tests/_support/GanttTest.yml b/tests/_support/GanttTest.yml new file mode 100644 index 00000000..1568278b --- /dev/null +++ b/tests/_support/GanttTest.yml @@ -0,0 +1,53 @@ +testGantticonfileiterator: + gantticonex1.php: { title: gantticonFileIterator, filename: gantticonex1.php } +testGanttconstrainfileiterator: + ganttconstrainex0.php: { title: ganttconstrainFileIterator, filename: ganttconstrainex0.php } + ganttconstrainex1.php: { title: ganttconstrainFileIterator, filename: ganttconstrainex1.php } + ganttconstrainex2.php: { title: ganttconstrainFileIterator, filename: ganttconstrainex2.php } +testGanttsamerowfileiterator: + gantt_samerowex1.php: { title: ganttSamerowFileIterator, filename: gantt_samerowex1.php } + gantt_samerowex2.php: { title: ganttSamerowFileIterator, filename: gantt_samerowex2.php } +testGantttfileiterator: + gantt_textex1.php: { title: ganttTFileIterator, filename: gantt_textex1.php } +testGanttcolumnfontsfileiterator: + ganttcolumnfontsex01.php: { title: ganttcolumnfontsFileIterator, filename: ganttcolumnfontsex01.php } +testGanttfileiterator: + ganttex00.php: { title: ganttFileIterator, filename: ganttex00.php } + ganttex01.php: { title: ganttFileIterator, filename: ganttex01.php } + ganttex02.php: { title: ganttFileIterator, filename: ganttex02.php } + ganttex03.php: { title: ganttFileIterator, filename: ganttex03.php } + ganttex04.php: { title: ganttFileIterator, filename: ganttex04.php } + ganttex05.php: { title: ganttFileIterator, filename: ganttex05.php } + ganttex06.php: { title: ganttFileIterator, filename: ganttex06.php } + ganttex07.php: { title: ganttFileIterator, filename: ganttex07.php } + ganttex08.php: { title: ganttFileIterator, filename: ganttex08.php } + ganttex09.php: { title: ganttFileIterator, filename: ganttex09.php } + ganttex10.php: { title: ganttFileIterator, filename: ganttex10.php } + ganttex11.php: { title: ganttFileIterator, filename: ganttex11.php } + ganttex12.php: { title: ganttFileIterator, filename: ganttex12.php } + ganttex13-zoom1.php: { title: ganttFileIterator, filename: ganttex13-zoom1.php } + ganttex13-zoom2.php: { title: ganttFileIterator, filename: ganttex13-zoom2.php } + ganttex13.php: { title: ganttFileIterator, filename: ganttex13.php } + ganttex14.php: { title: ganttFileIterator, filename: ganttex14.php } + ganttex15.php: { title: ganttFileIterator, filename: ganttex15.php } + ganttex16.php: { title: ganttFileIterator, filename: ganttex16.php } + ganttex17-flag.php: { title: ganttFileIterator, filename: ganttex17-flag.php } + ganttex17.php: { title: ganttFileIterator, filename: ganttex17.php } + ganttex18.php: { title: ganttFileIterator, filename: ganttex18.php } + ganttex30.php: { title: ganttFileIterator, filename: ganttex30.php } + ganttex_slice.php: { title: ganttFileIterator, filename: ganttex_slice.php } +testGanttsimplefileiterator: + ganttsimpleex1.php: { title: ganttsimpleFileIterator, filename: ganttsimpleex1.php } +testGantthourfileiterator: + gantthourex1.php: { title: gantthourFileIterator, filename: gantthourex1.php } +testMultconstganttfileiterator: + multconstganttex01.php: { title: multconstganttFileIterator, filename: multconstganttex01.php } +testGantthourminfileiterator: + gantthourminex1.php: { title: gantthourminFileIterator, filename: gantthourminex1.php } +testGanttmonthyearfileiterator: + ganttmonthyearex1.php: { title: ganttmonthyearFileIterator, filename: ganttmonthyearex1.php } + ganttmonthyearex2.php: { title: ganttmonthyearFileIterator, filename: ganttmonthyearex2.php } + ganttmonthyearex3.php: { title: ganttmonthyearFileIterator, filename: ganttmonthyearex3.php } + ganttmonthyearex4.php: { title: ganttmonthyearFileIterator, filename: ganttmonthyearex4.php } +testGantthgridfileiterator: + gantthgridex1.php: { title: gantthgridFileIterator, filename: gantthgridex1.php } diff --git a/tests/_support/GeneralTest.yml b/tests/_support/GeneralTest.yml new file mode 100644 index 00000000..4abc02e8 --- /dev/null +++ b/tests/_support/GeneralTest.yml @@ -0,0 +1,54 @@ +testFileiterator: + example0-0.php: { width: 350, height: 250, title: FileIterator, filename: example0-0.php } + example0.php: { width: 350, height: 250, title: FileIterator, filename: example0.php } + example1.1.php: { width: 350, height: 250, title: FileIterator, filename: example1.1.php } + example1.2.php: { width: 350, height: 250, title: FileIterator, filename: example1.2.php } + example1.php: { width: 300, height: 200, title: FileIterator, filename: example1.php } + example10.php: { width: 350, height: 200, title: FileIterator, filename: example10.php } + example11.php: { width: 300, height: 200, title: FileIterator, filename: example11.php } + example13.php: { width: 300, height: 200, title: FileIterator, filename: example13.php } + example14.php: { width: 300, height: 200, title: FileIterator, filename: example14.php } + example15.php: { width: 300, height: 200, title: FileIterator, filename: example15.php } + example16.1.php: { width: 400, height: 200, title: FileIterator, filename: example16.1.php } + example16.6.php: { width: 300, height: 250, title: FileIterator, filename: example16.6.php } + example16.php: { width: 300, height: 200, title: FileIterator, filename: example16.php } + example17.php: { width: 300, height: 200, title: FileIterator, filename: example17.php } + example2.1.php: { width: 300, height: 200, title: FileIterator, filename: example2.1.php } + example2.5.php: { width: 300, height: 200, title: FileIterator, filename: example2.5.php } + example2.6.php: { width: 300, height: 200, title: FileIterator, filename: example2.6.php } + example2.php: { width: 350, height: 250, title: FileIterator, filename: example2.php } + example26.1.php: { width: 300, height: 200, title: FileIterator, filename: example26.1.php } + example26.php: { width: 300, height: 200, title: FileIterator, filename: example26.php } + example27.1.php: { width: 300, height: 200, title: FileIterator, filename: example27.1.php } + example27.2.php: { width: 300, height: 200, title: FileIterator, filename: example27.2.php } + example27.3.php: { width: 330, height: 200, title: FileIterator, filename: example27.3.php } + example27.php: { width: 300, height: 200, title: FileIterator, filename: example27.php } + example28.1.php: { width: 150, height: 150, title: FileIterator, filename: example28.1.php } + example28.2.php: { width: 150, height: 150, title: FileIterator, filename: example28.2.php } + example28.3.php: { width: 150, height: 150, title: FileIterator, filename: example28.3.php } + example28.php: { width: 150, height: 150, title: FileIterator, filename: example28.php } + example3.0.1.php: { width: 350, height: 250, title: FileIterator, filename: example3.0.1.php } + example3.0.2.php: { width: 350, height: 250, title: FileIterator, filename: example3.0.2.php } + example3.0.3.php: { width: 350, height: 250, title: FileIterator, filename: example3.0.3.php } + example3.1.1.php: { width: 350, height: 250, title: FileIterator, filename: example3.1.1.php } + example3.1.php: { width: 350, height: 250, title: FileIterator, filename: example3.1.php } + example3.2.1.php: { width: 300, height: 200, title: FileIterator, filename: example3.2.1.php } + example3.2.2.php: { width: 300, height: 200, title: FileIterator, filename: example3.2.2.php } + example3.2.php: { width: 300, height: 200, title: FileIterator, filename: example3.2.php } + example3.3.php: { width: 350, height: 250, title: FileIterator, filename: example3.3.php } + example3.4.1.php: { width: 350, height: 250, title: FileIterator, filename: example3.4.1.php } + example3.4.php: { width: 350, height: 250, title: FileIterator, filename: example3.4.php } + example3.php: { width: 350, height: 250, title: FileIterator, filename: example3.php } + example4.php: { width: 350, height: 250, title: FileIterator, filename: example4.php } + example5.1.php: { width: 300, height: 200, title: FileIterator, filename: example5.1.php } + example5.php: { width: 300, height: 200, title: FileIterator, filename: example5.php } + example6.1.php: { width: 300, height: 240, title: FileIterator, filename: example6.1.php } + example6.2.php: { width: 300, height: 240, title: FileIterator, filename: example6.2.php } + example6.php: { width: 400, height: 200, title: FileIterator, filename: example6.php } + example7.php: { width: 350, height: 200, title: FileIterator, filename: example7.php } + example8.1.php: { width: 350, height: 200, title: FileIterator, filename: example8.1.php } + example8.php: { width: 350, height: 200, title: FileIterator, filename: example8.php } + example9.1.php: { width: 350, height: 200, title: FileIterator, filename: example9.1.php } + example9.2.php: { width: 350, height: 200, title: FileIterator, filename: example9.2.php } + example9.php: { width: 350, height: 200, title: FileIterator, filename: example9.php } + exampleex9.php: { width: 350, height: 200, title: FileIterator, filename: exampleex9.php } diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php index b5386431..60983e71 100644 --- a/tests/_support/Helper/Unit.php +++ b/tests/_support/Helper/Unit.php @@ -1,9 +1,10 @@ expectException(MyException::class, function() { + * $this->doSomethingBad(); + * }); + * + * $I->expectException(new MyException(), function() { + * $this->doSomethingBad(); + * }); + * ``` + * If you want to check message or exception code, you can pass them with exception instance: + * ```php + * expectException(new MyException("Don't do bad things"), function() { + * $this->doSomethingBad(); + * }); + * ``` + * + * @deprecated Use expectThrowable() instead + * @param $exception string or \Exception + * @param $callback + * @see \Codeception\Module\Asserts::expectException() + */ + public function expectException($exception, $callback) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Handles and checks throwables (Exceptions/Errors) called inside the callback function. + * Either throwable class name or throwable instance should be provided. + * + * ```php + * expectThrowable(MyThrowable::class, function() { + * $this->doSomethingBad(); + * }); + * + * $I->expectThrowable(new MyException(), function() { + * $this->doSomethingBad(); + * }); + * ``` + * If you want to check message or throwable code, you can pass them with throwable instance: + * ```php + * expectThrowable(new MyError("Don't do bad things"), function() { + * $this->doSomethingBad(); + * }); + * ``` + * + * @param $throwable string or \Throwable + * @param $callback + * @see \Codeception\Module\Asserts::expectThrowable() + */ + public function expectThrowable($throwable, $callback) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that two variables are equal. + * + * @param $expected + * @param $actual + * @param string $message + * @param float $delta + * @see \Codeception\Module\Asserts::assertEquals() + */ + public function assertEquals($expected, $actual, $message = null, $delta = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that two variables are not equal + * + * @param $expected + * @param $actual + * @param string $message + * @param float $delta + * @see \Codeception\Module\Asserts::assertNotEquals() + */ + public function assertNotEquals($expected, $actual, $message = null, $delta = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that two variables are same + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertSame() + */ + public function assertSame($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that two variables are not same + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotSame() + */ + public function assertNotSame($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that actual is greater than expected + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertGreaterThan() + */ + public function assertGreaterThan($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that actual is greater or equal than expected + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() + */ + public function assertGreaterThanOrEqual($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that actual is less than expected + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertLessThan() + */ + public function assertLessThan($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that actual is less or equal than expected + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertLessThanOrEqual() + */ + public function assertLessThanOrEqual($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that haystack contains needle + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\Asserts::assertContains() + */ + public function assertContains($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that haystack doesn't contain needle. + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\Asserts::assertNotContains() + */ + public function assertNotContains($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that string match with pattern + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\Asserts::assertRegExp() + */ + public function assertRegExp($pattern, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that string not match with pattern + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\Asserts::assertNotRegExp() + */ + public function assertNotRegExp($pattern, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that a string starts with the given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @see \Codeception\Module\Asserts::assertStringStartsWith() + */ + public function assertStringStartsWith($prefix, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that a string doesn't start with the given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @see \Codeception\Module\Asserts::assertStringStartsNotWith() + */ + public function assertStringStartsNotWith($prefix, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertEmpty() + */ + public function assertEmpty($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is not empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotEmpty() + */ + public function assertNotEmpty($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is NULL + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNull() + */ + public function assertNull($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is not NULL + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotNull() + */ + public function assertNotNull($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that condition is positive. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertTrue() + */ + public function assertTrue($condition, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the condition is NOT true (everything but true) + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertNotTrue() + */ + public function assertNotTrue($condition, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that condition is negative. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertFalse() + */ + public function assertFalse($condition, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the condition is NOT false (everything but false) + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertNotFalse() + */ + public function assertNotFalse($condition, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file exists + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\Asserts::assertFileExists() + */ + public function assertFileExists($filename, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file doesn't exist + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\Asserts::assertFileNotExists() + */ + public function assertFileNotExists($filename, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $expected + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertGreaterOrEquals() + */ + public function assertGreaterOrEquals($expected, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $expected + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertLessOrEquals() + */ + public function assertLessOrEquals($expected, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertIsEmpty() + */ + public function assertIsEmpty($actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $key + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertArrayHasKey() + */ + public function assertArrayHasKey($key, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $key + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertArrayNotHasKey() + */ + public function assertArrayNotHasKey($key, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $expectedCount + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertCount() + */ + public function assertCount($expectedCount, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $class + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertInstanceOf() + */ + public function assertInstanceOf($class, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $class + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertNotInstanceOf() + */ + public function assertNotInstanceOf($class, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $type + * @param $actual + * @param $description + * @see \Codeception\Module\Asserts::assertInternalType() + */ + public function assertInternalType($type, $actual, $description = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Fails the test with message. + * + * @param $message + * @see \Codeception\Module\Asserts::fail() + */ + public function fail($message) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertStringContainsString() + */ + public function assertStringContainsString($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertStringNotContainsString() + */ + public function assertStringNotContainsString($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertStringContainsStringIgnoringCase() + */ + public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertStringNotContainsStringIgnoringCase() + */ + public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @since 1.1.0 of module-asserts + * @see \Codeception\Module\Asserts::assertStringEndsWith() + */ + public function assertStringEndsWith($suffix, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @since 1.1.0 of module-asserts + * @see \Codeception\Module\Asserts::assertStringEndsNotWith() + */ + public function assertStringEndsNotWith($suffix, $string, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsArray() + */ + public function assertIsArray($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsBool() + */ + public function assertIsBool($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsFloat() + */ + public function assertIsFloat($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsInt() + */ + public function assertIsInt($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNumeric() + */ + public function assertIsNumeric($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsObject() + */ + public function assertIsObject($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsResource() + */ + public function assertIsResource($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsString() + */ + public function assertIsString($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsScalar() + */ + public function assertIsScalar($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsCallable() + */ + public function assertIsCallable($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotArray() + */ + public function assertIsNotArray($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotBool() + */ + public function assertIsNotBool($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotFloat() + */ + public function assertIsNotFloat($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotInt() + */ + public function assertIsNotInt($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotNumeric() + */ + public function assertIsNotNumeric($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotObject() + */ + public function assertIsNotObject($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotResource() + */ + public function assertIsNotResource($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotString() + */ + public function assertIsNotString($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotScalar() + */ + public function assertIsNotScalar($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertIsNotCallable() + */ + public function assertIsNotCallable($actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertEqualsCanonicalizing() + */ + public function assertEqualsCanonicalizing($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertNotEqualsCanonicalizing() + */ + public function assertNotEqualsCanonicalizing($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertEqualsIgnoringCase() + */ + public function assertEqualsIgnoringCase($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertNotEqualsIgnoringCase() + */ + public function assertNotEqualsIgnoringCase($expected, $actual, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertEqualsWithDelta() + */ + public function assertEqualsWithDelta($expected, $actual, $delta, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\Asserts::assertNotEqualsWithDelta() + */ + public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args())); + } +} diff --git a/tests/unit.suite.yml b/tests/unit.suite.yml index ba2d30c0..e1a67204 100644 --- a/tests/unit.suite.yml +++ b/tests/unit.suite.yml @@ -2,8 +2,6 @@ # # Suite for unit or integration tests. -actor: UnitWizard modules: - enabled: - - Asserts - - \Helper\Unit \ No newline at end of file + enabled: + - Asserts diff --git a/tests/unit/AxisTest.php b/tests/unit/AxisTest.php deleted file mode 100644 index 2660e72e..00000000 --- a/tests/unit/AxisTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/BackgroundTest.php b/tests/unit/BackgroundTest.php deleted file mode 100644 index d054be70..00000000 --- a/tests/unit/BackgroundTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/BarTest.php b/tests/unit/BarTest.php deleted file mode 100644 index e2126ec5..00000000 --- a/tests/unit/BarTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/CanvasTest.php b/tests/unit/CanvasTest.php deleted file mode 100644 index 6bc893b5..00000000 --- a/tests/unit/CanvasTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/ContourTest.php b/tests/unit/ContourTest.php deleted file mode 100644 index 92ea0555..00000000 --- a/tests/unit/ContourTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/DateTest.php b/tests/unit/DateTest.php deleted file mode 100644 index 09db0218..00000000 --- a/tests/unit/DateTest.php +++ /dev/null @@ -1,39 +0,0 @@ -exampleRoot = UNIT_TEST_FOLDER . '/Examples/examples_' . $className . '/'; - } - - protected function _after() - { - } - - // tests - public function _fileCheck($filename) - { - ob_start(); - include $this->exampleRoot . $filename; - $img = (ob_get_clean()); - $size = getimagesizefromstring($img); - if ($__width != $size[0] || $__height != $size[1]) { - rename(self::$exampleRoot . $filename, self::$exampleRoot . 'no_dim_' . $filename); - } - $this->assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - $files = GetFiles($this->exampleRoot); - foreach ($files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/GanttTest.php b/tests/unit/GanttTest.php deleted file mode 100644 index f7fec1e9..00000000 --- a/tests/unit/GanttTest.php +++ /dev/null @@ -1,35 +0,0 @@ -exampleRoot = UNIT_TEST_FOLDER . '/Examples/examples_' . $className . '/'; - } - - protected function _after() - { - } - - // tests - public function _fileCheck($filename) - { - ob_start(); - include $this->exampleRoot . $filename; - $img = (ob_get_clean()); - $size = getimagesizefromstring($img); - $this->assertEquals('image/png', $size['mime'], 'image should have mime image/png for ' . $filename); - } - - public function testFileIterator() - { - $files = GetFiles($this->exampleRoot); - foreach ($files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/GeneralTest.php b/tests/unit/GeneralTest.php deleted file mode 100644 index cc383ff5..00000000 --- a/tests/unit/GeneralTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/ImgTest.php b/tests/unit/ImgTest.php deleted file mode 100644 index 46a70c1f..00000000 --- a/tests/unit/ImgTest.php +++ /dev/null @@ -1,64 +0,0 @@ -_fileCheck($filename, __METHOD__); - } - - public function testFile1() - { - $filename = array_pop(self::$files); - $this->_fileCheck($filename, __METHOD__); - } - - private function _fileCheck($filename, $from) - { - \Codeception\Util\Debug::debug('after ' . $from . ' ' . __CLASS__ . ' has ' . count(self::$files) . ' files left'); - ob_start(); - include self::$exampleRoot . $filename; - $img = (ob_get_clean()); - $size = getimagesizefromstring($img); - - $size['filename'] = $filename; - if (!isset($__width) || !isset($__height)) { - $this->assertEquals('image/jpeg', $size['mime'], 'image should have mime image/jpeg for ' . $filename); - } elseif ($__width != $size[0] || $__height != $size[1]) { - rename(self::$exampleRoot . $filename, self::$exampleRoot . 'no_dim_' . $filename); - } else { - $this->assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - } - - public function testFileIterator() - { - while (count(self::$files)) { - $filename = array_pop(self::$files); - $this->_fileCheck($filename, __METHOD__); - } - } -} diff --git a/tests/unit/LineTest.php b/tests/unit/LineTest.php deleted file mode 100644 index 4b73301a..00000000 --- a/tests/unit/LineTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/PieTest.php b/tests/unit/PieTest.php deleted file mode 100644 index 76b78cdf..00000000 --- a/tests/unit/PieTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/RotateTest.php b/tests/unit/RotateTest.php deleted file mode 100644 index 528f6fa2..00000000 --- a/tests/unit/RotateTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/ScatterTest.php b/tests/unit/ScatterTest.php deleted file mode 100644 index 9827f780..00000000 --- a/tests/unit/ScatterTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/StaticbandTest.php b/tests/unit/StaticbandTest.php deleted file mode 100644 index f51cc1d1..00000000 --- a/tests/unit/StaticbandTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/ThemeTest.php b/tests/unit/ThemeTest.php deleted file mode 100644 index 1f6736b4..00000000 --- a/tests/unit/ThemeTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/TickTest.php b/tests/unit/TickTest.php deleted file mode 100644 index caca87d2..00000000 --- a/tests/unit/TickTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/WindroseTest.php b/tests/unit/WindroseTest.php deleted file mode 100644 index 747e77c1..00000000 --- a/tests/unit/WindroseTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals($__width, $size[0], 'width should match the one declared for ' . $filename); - $this->assertEquals($__height, $size[1], 'height should match the one declared for ' . $filename); - } - - public function testFileIterator() - { - foreach (self::$files as $file) { - $this->_fileCheck($file); - } - } -} diff --git a/tests/unit/_bootstrap.php b/tests/unit/_bootstrap.php deleted file mode 100644 index d3b02f4f..00000000 --- a/tests/unit/_bootstrap.php +++ /dev/null @@ -1,39 +0,0 @@ -Read()) { - if (is_file($folder . $entry) && - strstr($entry, '.php') && - strstr($entry, 'ex') - && !strstr($entry, 'no_test') - && !strstr($entry, 'no_dim')) { - $a[] = $entry; - } - } - $d->Close(); - if (count($a) == 0) { - die("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: {$folder}"); - } - sort($a); - - return $a; -} - -function getRoot($class) -{ - return UNIT_TEST_FOLDER . '/Examples/examples_' . $class . '/'; -} - -define('UNIT_TEST_FOLDER', dirname(dirname(__DIR__))); diff --git a/tests/unit/_not_ready_RadarTest.xphp b/tests/unit/_not_ready_RadarTest.xphp deleted file mode 100644 index 32e795ca..00000000 --- a/tests/unit/_not_ready_RadarTest.xphp +++ /dev/null @@ -1,33 +0,0 @@ -exampleRoot = UNIT_TEST_FOLDER . '/Examples/examples_' . $className . '/'; - } - - protected function _after() - { - } - - // tests - public function _fileCheck($filename) - { - ob_start(); - include $this->exampleRoot . $filename; - $img = (ob_get_clean()); - $size = getimagesizefromstring($img); - \Codeception\Util\Debug::debug($size); - } - - public function testFileIterator() - { - $files = GetFiles($this->exampleRoot); - foreach ($files as $file) { - $this->_fileCheck($file); - } - } -}