1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Yawik\Migration\Tests\Migrator\Version36; |
6
|
|
|
|
7
|
|
|
use CoreTestUtils\TestCase\FunctionalTestCase; |
|
|
|
|
8
|
|
|
use Symfony\Component\Console\Output\StreamOutput; |
9
|
|
|
use Yawik\Migration\Migrator\Version36\FileProcessor; |
10
|
|
|
use Yawik\Migration\Tests\DatabaseConcernTrait; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class FileProcessorTest |
14
|
|
|
* |
15
|
|
|
* @covers \Yawik\Migration\Migrator\Version36\FileProcessor |
16
|
|
|
* @package Yawik\Migration\Tests\Migrator\Version36 |
17
|
|
|
*/ |
18
|
|
|
class FileProcessorTest extends FunctionalTestCase |
19
|
|
|
{ |
20
|
|
|
use DatabaseConcernTrait; |
21
|
|
|
|
22
|
|
|
public function setUp(): void |
23
|
|
|
{ |
24
|
|
|
parent::setUp(); |
25
|
|
|
$this->initialize($this->getApplicationServiceLocator()); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
private function createData() |
29
|
|
|
{ |
30
|
|
|
$bucket = $this->getBucket('test.files'); |
31
|
|
|
$this->drop('test'); |
32
|
|
|
$bucket->drop(); |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
$this->createFile('test'); |
36
|
|
|
$this->createFile('test'); |
37
|
|
|
$this->createFile("test"); |
38
|
|
|
$this->createFile('test'); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
private function createProcessor() |
42
|
|
|
{ |
43
|
|
|
$stream = fopen('php://memory', 'w', \false); |
44
|
|
|
|
45
|
|
|
return new FileProcessor( |
46
|
|
|
$this->getDoctrine(), |
47
|
|
|
new StreamOutput($stream), |
48
|
|
|
'test' |
49
|
|
|
); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function testProcess() |
53
|
|
|
{ |
54
|
|
|
$this->createData(); |
55
|
|
|
$target = $this->createProcessor(); |
56
|
|
|
$target->process(); |
57
|
|
|
|
58
|
|
|
$bucket = $this->getBucket('test'); |
59
|
|
|
$cursor = $bucket->find(); |
60
|
|
|
foreach($cursor as $current){ |
61
|
|
|
$this->assertFileMigrated($current); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
protected function assertFileMigrated(array $file) |
66
|
|
|
{ |
67
|
|
|
$bucket = $this->getBucket('test.files'); |
|
|
|
|
68
|
|
|
$this->assertNotNull($file); |
69
|
|
|
$this->assertNotNull($this->getNamespacedValue('metadata', $file)); |
70
|
|
|
$this->assertNull($this->getNamespacedValue('dateuploaded', $file)); |
71
|
|
|
$this->assertNull($this->getNamespacedValue('permissions', $file)); |
72
|
|
|
} |
73
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths