This repository was archived by the owner on May 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -198,15 +198,22 @@ public function writing_a_file_writes_a_compressed_and_encrypted_file(): void
198
198
public function regression (): void
199
199
{
200
200
$ key = 'RjWFkMrJS4Jd5TDdhYJNAWdfSEL5nptu4KQHgkeKGI0= ' ;
201
- $ content = base64_decode ('IZS+uLwIi3vfk+/txrq+7V7vQ0GGN9cwWetC8p/IRMstNUFfxB363Dt1jwxM7LbK3M4EX4earQ== ' , true );
202
-
201
+ $ originalPlain = 'foobar ' ;
203
202
$ adapter = new CompressAndEncryptAdapter (
204
203
new LocalFilesystemAdapter ($ this ->remoteMock ),
205
204
$ key
206
205
);
206
+
207
+ // To recreate assets, uncomment following lines
208
+ // $adapter->write('/file.txt', $originalPlain, new Config());
209
+ // var_dump(
210
+ // base64_encode(file_get_contents($this->remoteMock.'/file.txt'.CompressAndEncryptAdapter::REMOTE_FILE_EXTENSION))
211
+ // ); exit;
212
+
213
+ $ content = base64_decode ('Zp1CKRNAdEebRInjHnuJwuG1gI2owWedBVboddwd+sW4AKv/3a112UjHnlpJntUUZgPBStuSFw== ' , true );
207
214
file_put_contents ($ this ->remoteMock .'/file.txt ' .CompressAndEncryptAdapter::REMOTE_FILE_EXTENSION , $ content );
208
215
209
- static ::assertSame (' foobar ' , $ adapter ->read ('/file.txt ' ));
216
+ static ::assertSame ($ originalPlain , $ adapter ->read ('/file.txt ' ));
210
217
}
211
218
212
219
/**
Original file line number Diff line number Diff line change @@ -135,18 +135,26 @@ public function consecutive_filtering(): void
135
135
public function regression (): void
136
136
{
137
137
$ key = base64_decode ('Z+Ry4nDufKcJ19pU2pEMgGiac9GBWFjEV18Cpb9jxRM= ' , true );
138
- $ cipher = base64_decode ('PMRzbW/xSj1WPnXp0DknCZvmM1Lv1XCYNbQH5wHozLpULVaGnoq7kVOuhg5Guew= ' , true );
139
-
138
+ $ originalPlain = 'foobar ' ;
140
139
EncryptorStreamFilter::register ();
141
140
141
+ // To recreate assets, uncomment following lines
142
+ // $cipherStream = $this->streamFromContents($content);
143
+ // EncryptorStreamFilter::appendEncryption($cipherStream, $key);
144
+ // $cipher = stream_get_contents($cipherStream);
145
+ // fclose($cipherStream);
146
+ // var_dump(base64_encode($cipher)); exit;
147
+
148
+ $ cipher = base64_decode ('UbQpWpd03RyW8a2YiVQSlkmfeEN76IgkN67yPRb7UoXcxUeL7LmUGizXL7zwbtc= ' , true );
149
+
142
150
$ plainStream = $ this ->streamFromContents ($ cipher );
143
151
EncryptorStreamFilter::appendDecryption ($ plainStream , $ key );
144
152
145
153
$ plain = stream_get_contents ($ plainStream );
146
154
147
155
fclose ($ plainStream );
148
156
149
- static ::assertSame (' foobar ' , $ plain );
157
+ static ::assertSame ($ originalPlain , $ plain );
150
158
}
151
159
152
160
/**
You can’t perform that action at this time.
0 commit comments