Skip to content

Commit

Permalink
test on phpunit 8 + some minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
garak committed Mar 28, 2019
1 parent 3458286 commit f057512
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.php_cs.cache
.*.cache
phpunit.xml
composer.lock
vendor/
4 changes: 2 additions & 2 deletions Resources/doc/form/vich_file_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Can be callable
use Vich\UploaderBundle\Form\Type\VichFileType;

$builder->add('genericFile', VichFileType::class, [
'download_uri' => function (Product $product) use ($router) {
'download_uri' => static function (Product $product) use ($router) {
return $router->generateUrl('acme_download_image', $product->getId());
},
]);
Expand Down Expand Up @@ -83,7 +83,7 @@ Can be callable
use Vich\UploaderBundle\Form\Type\VichFileType;

$builder->add('genericFile', VichFileType::class, [
'download_label' => function (Product $product) {
'download_label' => static function (Product $product) {
return $product->getTitle();
},
]);
Expand Down
6 changes: 3 additions & 3 deletions Resources/doc/form/vich_image_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Can be callable
use Vich\UploaderBundle\Form\Type\VichImageType;

$builder->add('genericFile', VichImageType::class, [
'download_uri' => function (Product $product) use ($router) {
'download_uri' => static function (Product $product) use ($router) {
return $router->generateUrl('acme_download_image', $product->getId());
},
]);
Expand Down Expand Up @@ -85,7 +85,7 @@ Can be callable
use Vich\UploaderBundle\Form\Type\VichImageType;

$builder->add('genericFile', VichImageType::class, [
'download_label' => function (Product $product) {
'download_label' => static function (Product $product) {
return $product->getTitle();
},
]);
Expand Down Expand Up @@ -126,7 +126,7 @@ Can be callable
use Vich\UploaderBundle\Form\Type\VichImageType;

$builder->add('genericFile', VichImageType::class, [
'image_uri' => function (Photo $photo, $resolvedUri) use ($cacheManager) {
'image_uri' => static function (Photo $photo, $resolvedUri) use ($cacheManager) {
// $cacheManager is LiipImagine cache manager
return $cacheManager->getBrowserPath(
$resolvedUri,
Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/VichUploaderExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

class VichUploaderExtensionTest extends AbstractExtensionTestCase
{
protected function getContainerExtensions()
protected function getContainerExtensions(): array
{
return [
new VichUploaderExtension(),
];
}

protected function getMinimalConfiguration()
protected function getMinimalConfiguration(): array
{
return [
'db_driver' => 'propel',
Expand Down
6 changes: 3 additions & 3 deletions Tests/Form/Type/VichFileTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function buildViewDataProvider(): array
$object,
[
'download_label' => 'download',
'download_uri' => function (Product $product) {
'download_uri' => static function (Product $product) {
return '/download/'.$product->getImageOriginalName();
},
],
Expand Down Expand Up @@ -218,7 +218,7 @@ public function buildViewDataProvider(): array
[
$object,
[
'download_label' => function (Product $product) {
'download_label' => static function (Product $product) {
return 'prefix-'.$product->getImageOriginalName();
},
'download_uri' => true,
Expand All @@ -235,7 +235,7 @@ public function buildViewDataProvider(): array
[
$object,
[
'download_label' => function (Product $product) {
'download_label' => static function (Product $product) {
return [
'download_label' => 'prefix-'.$product->getImageOriginalName(),
'translation_domain' => 'messages',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Form/Type/VichImageTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function buildViewDataProvider(): array
[
'download_label' => 'download',
'download_uri' => 'custom-uri',
'image_uri' => function (Product $product, $resolvedUri) {
'image_uri' => static function (Product $product, $resolvedUri) {
return 'prefix-'.$resolvedUri;
},
'imagine_pattern' => null,
Expand Down
1 change: 1 addition & 0 deletions Tests/Naming/CurrentDateTimeDirectoryNamerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function directoryNameDataProvider(): array
*/
public function testNameReturnsTheRightName(int $timestamp, ?string $dateTimeFormat, string $expectedName): void
{
\date_default_timezone_set('UTC');
$entity = new DummyEntity();
$mapping = $this->getPropertyMappingMock();

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"doctrine/mongodb-odm": "^1.2",
"doctrine/orm": "^2.5",
"knplabs/knp-gaufrette-bundle": "^0.5",
"matthiasnoback/symfony-dependency-injection-test": "^2.3|^3.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"mikey179/vfsstream": "^1.6",
"oneup/flysystem-bundle": "^3.0",
"phpunit/phpunit": "^6.5|^7.0",
"phpunit/phpunit": "^7.0|^8.0",
"symfony/browser-kit": "^3.4|^4.0",
"symfony/css-selector": "^3.4|^4.0",
"symfony/doctrine-bridge": "^3.4|^4.0",
Expand Down

0 comments on commit f057512

Please sign in to comment.