summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-file-pr14.patch
blob: 0ca09294767b3b68201cf68c1c7083507900b4cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
From d28ddbaf85e4d24fc6b5a10ddb4ad0636f4a3594 Mon Sep 17 00:00:00 2001
From: Christophe Robert <christophe.robert@babblecar.com>
Date: Wed, 10 Feb 2016 17:38:50 +0100
Subject: [PATCH 1/2] Merge property aliases instead of replacing

---
 src/Transfer/Adapter/FilterPluginManager.php | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/Transfer/Adapter/FilterPluginManager.php b/src/Transfer/Adapter/FilterPluginManager.php
index 3fa9456..a4a1bc3 100644
--- a/src/Transfer/Adapter/FilterPluginManager.php
+++ b/src/Transfer/Adapter/FilterPluginManager.php
@@ -10,6 +10,7 @@
 namespace Zend\File\Transfer\Adapter;
 
 use Zend\Filter\FilterPluginManager as BaseManager;
+use Zend\Filter\File;
 
 /**
  * Plugin manager implementation for the filter chain.
@@ -20,16 +21,19 @@
  */
 class FilterPluginManager extends BaseManager
 {
-    /**
-     * Default set of filters
-     *
-     * @var array
-     */
-    protected $aliases = [
-        'decrypt'   => 'filedecrypt',
-        'encrypt'   => 'fileencrypt',
-        'lowercase' => 'filelowercase',
-        'rename'    => 'filerename',
-        'uppercase' => 'fileuppercase',
-    ];
+
+    public function __construct($configOrContainerInstance = null, array $v3config = []) 
+    {
+	parent::__construct($configOrContainerInstance, $v3config);
+        
+	$this->aliases = array_merge(array(
+            'decrypt'       => File\Decrypt::class,
+            'encrypt'       => File\Encrypt::class,
+            'lowercase'     => File\LowerCase::class,
+            'rename'        => File\Rename::class,
+            'uppercase'     => File\UpperCase::class
+        ), $this->aliases);
+    }
+
 }
+

From 8c7ef68e2e4dd6127ea1a71e763a96005dbb240f Mon Sep 17 00:00:00 2001
From: Christophe Robert <christophe.robert@babblecar.com>
Date: Wed, 10 Feb 2016 17:40:18 +0100
Subject: [PATCH 2/2] update teste

---
 composer.json                                 | 4 +++-
 test/Transfer/Adapter/AbstractTest.php        | 2 +-
 test/Transfer/Adapter/HttpTestMockAdapter.php | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/composer.json b/composer.json
index 1de3852..3a34854 100644
--- a/composer.json
+++ b/composer.json
@@ -17,10 +17,12 @@
         "zendframework/zend-stdlib": "~2.5"
     },
     "require-dev": {
-        "zendframework/zend-filter": "~2.5",
+        "zendframework/zend-filter": "~2.6",
         "zendframework/zend-i18n": "~2.5",
         "zendframework/zend-servicemanager": "~2.5",
         "zendframework/zend-validator": "~2.5",
+        "zendframework/zend-progressbar": "~2.5",
+        "zendframework/zend-session": "~2.5",
         "fabpot/php-cs-fixer": "1.7.*",
         "phpunit/PHPUnit": "~4.0"
     },
diff --git a/test/Transfer/Adapter/AbstractTest.php b/test/Transfer/Adapter/AbstractTest.php
index 294323b..976261a 100644
--- a/test/Transfer/Adapter/AbstractTest.php
+++ b/test/Transfer/Adapter/AbstractTest.php
@@ -301,7 +301,7 @@ public function testGetFilterShouldReturnNullWhenNoMatchingIdentifierExists()
 
     public function testAdapterShouldAllowPullingFiltersByFile()
     {
-        $this->adapter->addFilter('Boolean', 1, 'foo');
+        $this->adapter->addFilter('Boolean', [1], 'foo');
         $filters = $this->adapter->getFilters('foo');
         $this->assertEquals(1, count($filters));
         $filter = array_shift($filters);
diff --git a/test/Transfer/Adapter/HttpTestMockAdapter.php b/test/Transfer/Adapter/HttpTestMockAdapter.php
index ba0aa63..485a5a6 100644
--- a/test/Transfer/Adapter/HttpTestMockAdapter.php
+++ b/test/Transfer/Adapter/HttpTestMockAdapter.php
@@ -18,6 +18,8 @@
  */
 class HttpTestMockAdapter extends Adapter\Http
 {
+    static $aa = true;
+
     public function __construct()
     {
         self::$callbackApc = ['ZendTest\File\Transfer\Adapter\HttpTestMockAdapter', 'apcTest'];
@@ -36,7 +38,7 @@ public function isValidParent($files = null)
 
     public static function isApcAvailable()
     {
-        return true;
+        return static::$aa;
     }
 
     public static function apcTest($id)
@@ -50,7 +52,7 @@ public static function uPTest($id)
     }
 
     public function switchApcToUP()
-    {
+    {	static::$aa = false;
         self::$callbackApc = null;
         self::$callbackUploadProgress = ['ZendTest\File\Transfer\Adapter\HttpTestMockAdapter', 'uPTest'];
     }