1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-16 12:20:09 -07:00

Mock StlFixer in StlConverterTest

This commit is contained in:
Unknown 2017-05-28 23:40:46 +02:00
parent 1dc5f7f6c5
commit c01abcd657
3 changed files with 108 additions and 28 deletions

123
composer.lock generated
View File

@ -1909,6 +1909,75 @@
], ],
"time": "2017-04-24T08:44:27+00:00" "time": "2017-04-24T08:44:27+00:00"
}, },
{
"name": "pagerfanta/pagerfanta",
"version": "v1.0.5",
"source": {
"type": "git",
"url": "https://github.com/whiteoctober/Pagerfanta.git",
"reference": "29aade64addfdfb12c05aabf160f09d1aea6b143"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/29aade64addfdfb12c05aabf160f09d1aea6b143",
"reference": "29aade64addfdfb12c05aabf160f09d1aea6b143",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/orm": "~2.3",
"doctrine/phpcr-odm": "1.*",
"jackalope/jackalope-doctrine-dbal": "1.*",
"jmikola/geojson": "~1.0",
"mandango/mandango": "~1.0@dev",
"mandango/mondator": "~1.0@dev",
"phpunit/phpunit": "~4 | ~5",
"propel/propel": "~2.0@dev",
"propel/propel1": "~1.6",
"ruflin/elastica": "~1.3",
"solarium/solarium": "~3.1"
},
"suggest": {
"doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.",
"doctrine/orm": "To use the DoctrineORMAdapter.",
"doctrine/phpcr-odm": "To use the DoctrineODMPhpcrAdapter. >= 1.1.0",
"mandango/mandango": "To use the MandangoAdapter.",
"propel/propel": "To use the Propel2Adapter",
"propel/propel1": "To use the PropelAdapter",
"solarium/solarium": "To use the SolariumAdapter."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Pagerfanta\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pablo Díez",
"email": "pablodip@gmail.com"
}
],
"description": "Pagination for PHP 5.3",
"keywords": [
"page",
"pagination",
"paginator",
"paging"
],
"time": "2017-03-20T13:46:15+00:00"
},
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
"version": "v2.0.10", "version": "v2.0.10",
@ -2777,21 +2846,21 @@
}, },
{ {
"name": "symfony/swiftmailer-bundle", "name": "symfony/swiftmailer-bundle",
"version": "v2.5.4", "version": "v2.6.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/swiftmailer-bundle.git", "url": "https://github.com/symfony/swiftmailer-bundle.git",
"reference": "8ab32ce31a7156621fb92e0466586186beb89759" "reference": "deabc81120c2086571f7c4484ab785c5e1b84f75"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/8ab32ce31a7156621fb92e0466586186beb89759", "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/deabc81120c2086571f7c4484ab785c5e1b84f75",
"reference": "8ab32ce31a7156621fb92e0466586186beb89759", "reference": "deabc81120c2086571f7c4484ab785c5e1b84f75",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.2", "php": ">=5.3.2",
"swiftmailer/swiftmailer": ">=4.2.0,~5.0", "swiftmailer/swiftmailer": "~4.2|~5.0",
"symfony/config": "~2.7|~3.0", "symfony/config": "~2.7|~3.0",
"symfony/dependency-injection": "~2.7|~3.0", "symfony/dependency-injection": "~2.7|~3.0",
"symfony/http-kernel": "~2.7|~3.0" "symfony/http-kernel": "~2.7|~3.0"
@ -2799,7 +2868,7 @@
"require-dev": { "require-dev": {
"symfony/console": "~2.7|~3.0", "symfony/console": "~2.7|~3.0",
"symfony/framework-bundle": "~2.7|~3.0", "symfony/framework-bundle": "~2.7|~3.0",
"symfony/phpunit-bridge": "~2.7|~3.0", "symfony/phpunit-bridge": "~3.3@dev",
"symfony/yaml": "~2.7|~3.0" "symfony/yaml": "~2.7|~3.0"
}, },
"suggest": { "suggest": {
@ -2808,7 +2877,7 @@
"type": "symfony-bundle", "type": "symfony-bundle",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.5-dev" "dev-master": "2.6-dev"
} }
}, },
"autoload": { "autoload": {
@ -2832,7 +2901,7 @@
], ],
"description": "Symfony SwiftmailerBundle", "description": "Symfony SwiftmailerBundle",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2017-03-21T21:47:36+00:00" "time": "2017-05-22T04:58:24+00:00"
}, },
{ {
"name": "symfony/symfony", "name": "symfony/symfony",
@ -4259,16 +4328,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "6.1.3", "version": "6.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "824d02024916525a36b2db21847a5ef91db9e4a8" "reference": "42b7f394a8e009516582331b1e03a1aba40175d1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/824d02024916525a36b2db21847a5ef91db9e4a8", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/42b7f394a8e009516582331b1e03a1aba40175d1",
"reference": "824d02024916525a36b2db21847a5ef91db9e4a8", "reference": "42b7f394a8e009516582331b1e03a1aba40175d1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4288,8 +4357,8 @@
"phpunit/php-timer": "^1.0.6", "phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^4.0", "phpunit/phpunit-mock-objects": "^4.0",
"sebastian/comparator": "^2.0", "sebastian/comparator": "^2.0",
"sebastian/diff": "^1.2", "sebastian/diff": "^1.4.3 || ^2.0",
"sebastian/environment": "^3.0.1", "sebastian/environment": "^3.0.2",
"sebastian/exporter": "^3.1", "sebastian/exporter": "^3.1",
"sebastian/global-state": "^1.1 || ^2.0", "sebastian/global-state": "^1.1 || ^2.0",
"sebastian/object-enumerator": "^3.0.2", "sebastian/object-enumerator": "^3.0.2",
@ -4339,7 +4408,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2017-04-29T10:40:17+00:00" "time": "2017-05-22T07:45:30+00:00"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
@ -4511,23 +4580,23 @@
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "1.4.1", "version": "1.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": "^5.3.3 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.8" "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -4559,7 +4628,7 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"time": "2015-12-08T07:14:41+00:00" "time": "2017-05-22T07:24:03+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
@ -5015,16 +5084,16 @@
}, },
{ {
"name": "symfony/phpunit-bridge", "name": "symfony/phpunit-bridge",
"version": "dev-master", "version": "3.3.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git", "url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "9706535602ce13c31aee49ccee5d6bfd895aadb5" "reference": "f3c575cdc1ae01cc93b17f8fc13508b87e418f32"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/9706535602ce13c31aee49ccee5d6bfd895aadb5", "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/f3c575cdc1ae01cc93b17f8fc13508b87e418f32",
"reference": "9706535602ce13c31aee49ccee5d6bfd895aadb5", "reference": "f3c575cdc1ae01cc93b17f8fc13508b87e418f32",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5073,7 +5142,7 @@
], ],
"description": "Symfony PHPUnit Bridge", "description": "Symfony PHPUnit Bridge",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-12 14:14:56" "time": "2017-05-21 17:39:57"
}, },
{ {
"name": "symfony/polyfill-php54", "name": "symfony/polyfill-php54",

View File

@ -43,4 +43,9 @@ abstract class BaseTest extends WebTestCase
{ {
return $this->_container->get($service); return $this->_container->get($service);
} }
protected function getParameter($parameter)
{
return $this->_container->getParameter($parameter);
}
} }

View File

@ -3,6 +3,7 @@
namespace Tests\AppBundle\Service\Stl; namespace Tests\AppBundle\Service\Stl;
use AppBundle\Service\Stl\StlConverterService; use AppBundle\Service\Stl\StlConverterService;
use AppBundle\Service\Stl\StlFixerService;
use League\Flysystem\Adapter\Local; use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem; use League\Flysystem\Filesystem;
use Tests\AppBundle\Service\BaseTest; use Tests\AppBundle\Service\BaseTest;
@ -15,7 +16,12 @@ class StlConverterTest extends BaseTest
public function setUp() public function setUp()
{ {
$this->stlConverter = $this->get('service.stl.converter'); $ldview = $this->getParameter('ldview_bin');
$stlFixer = $this->createMock(StlFixerService::class);
$stlFixer->method('fix');
$this->stlConverter = new StlConverterService($ldview,$this->filesystem,$stlFixer);
$adapter = new Local(__DIR__.'/fixtures/ldraw'); $adapter = new Local(__DIR__.'/fixtures/ldraw');
$ldrawLibraryContext = new Filesystem($adapter); $ldrawLibraryContext = new Filesystem($adapter);