Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found

Cible

Sélectionner le projet cible
  • spip-league/composer-installer
1 résultat
Afficher les modifications
......@@ -18,7 +18,7 @@ class SpecificationStub implements SpecificationInterface
string $prefix = '',
string $vendorName = '',
string $constraint = '',
string $path = 'path'
string $path = 'path',
) {
$this->prefix = $prefix;
$this->vendorName = $vendorName;
......
......@@ -25,9 +25,7 @@ class SpipInstallerTest extends TestCase
$package->setExtra([
'spip' => [
'template' => 'spip/default-template',
'extensions' => [
'spip/mandatory',
],
'extensions' => ['spip/mandatory'],
],
]);
$composer->setPackage($package);
......
......@@ -43,11 +43,12 @@ class AnalyzerTest extends TestCase
$this->composer = new Composer();
$this->composer->setPackage($rootPackage);
$this->composer->setConfig(new Config());
$this->composer->getConfig()->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/AnalyzerTest.json'))
);
$this->composer->getConfig()->getConfigSource()->addConfigSetting('test', 'test');
$this->composer->setLoop(new Loop(new HttpDownloader(new NullIO, $this->composer->getConfig())));
$this->composer->getConfig()
->setConfigSource(new JsonConfigSource(new JsonFile($this->tmpDir . '/AnalyzerTest.json')));
$this->composer->getConfig()
->getConfigSource()
->addConfigSetting('test', 'test');
$this->composer->setLoop(new Loop(new HttpDownloader(new NullIO(), $this->composer->getConfig())));
}
protected function tearDown(): void
......
......@@ -32,7 +32,10 @@ class AddSpecificationTest extends TestCase
$this->filesystem->emptyDirectory($this->tmpDir);
$this->collection = new CollectionMock($this->tmpDir . '/AddSpecificationTest.json');
$this->collection[] = new SpecificationMock('exist');
\file_put_contents($this->tmpDir . '/AddSpecificationTest.json', '{"exist":{"path":"path","source":"https://git-server/vendor/exist.git","branch":"1.0","tag":"v1.0.0"}}');
\file_put_contents(
$this->tmpDir . '/AddSpecificationTest.json',
'{"exist":{"path":"path","source":"https://git-server/vendor/exist.git","branch":"1.0","tag":"v1.0.0"}}',
);
}
protected function tearDown(): void
......@@ -52,7 +55,6 @@ class AddSpecificationTest extends TestCase
'expected' => \null,
'prefix' => 'exist',
],
];
}
......@@ -66,7 +68,7 @@ class AddSpecificationTest extends TestCase
$actual = $operation->mark($this->collection, $this->composer);
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -32,15 +32,18 @@ class AddToRequireTest extends TestCase
$this->filesystem->emptyDirectory($this->tmpDir);
$rootPackage = new RootPackage('test/test', '1', '1');
$rootPackage->setRequires(['vendor/exist' => new Link('test/test', 'vendor/exist', new Constraint('>=', '1.0'))]);
$rootPackage->setRequires(
['vendor/exist' => new Link('test/test', 'vendor/exist', new Constraint('>=', '1.0'))],
);
$this->composer = new Composer();
$this->composer->setConfig(new Config());
$this->composer->getConfig()->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/AddToRequireTest.json'))
);
$this->composer->getConfig()
->setConfigSource(new JsonConfigSource(new JsonFile($this->tmpDir . '/AddToRequireTest.json')));
$this->composer->setPackage($rootPackage);
$this->composer->getConfig()->getConfigSource()->addLink('require', 'vendor/exist', '^1.0');
$this->composer->getConfig()
->getConfigSource()
->addLink('require', 'vendor/exist', '^1.0');
}
protected function tearDown(): void
......
......@@ -32,14 +32,16 @@ class AddToSpipExtraExtensionsTest extends TestCase
$this->composer = new Composer();
$this->composer->setConfig(new Config());
$this->composer->getConfig()->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/AddToSpipExtraExtensionsTest.json'))
);
$this->composer->getConfig()
->setConfigSource(new JsonConfigSource(new JsonFile($this->tmpDir . '/AddToSpipExtraExtensionsTest.json')));
$rootPackage = new RootPackage('test/test', '1', '1');
$this->composer->setPackage($rootPackage);
$this->composer->getConfig()->getConfigSource()->addProperty('extra.spip.extensions', ['vendor/exist']);
$this->composer->getPackage()->setExtra(['spip' => ['extensions' => ['vendor/exist']]]);
$this->composer->getConfig()
->getConfigSource()
->addProperty('extra.spip.extensions', ['vendor/exist']);
$this->composer->getPackage()
->setExtra(['spip' => ['extensions' => ['vendor/exist']]]);
}
protected function tearDown(): void
......@@ -72,7 +74,7 @@ class AddToSpipExtraExtensionsTest extends TestCase
$actual = $operation->mark(new CollectionDummy(), $this->composer);
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -50,7 +50,6 @@ class RemoveDirectoryTest extends TestCase
'expected' => OperationInterface::class,
'directory' => 'empty',
],
];
}
......@@ -64,7 +63,7 @@ class RemoveDirectoryTest extends TestCase
$actual = $operation->mark(new CollectionDummy(), new Composer());
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -33,15 +33,18 @@ class RemoveFromRequireTest extends TestCase
$this->filesystem->emptyDirectory($this->tmpDir);
$rootPackage = new RootPackage('test/test', '1', '1');
$rootPackage->setRequires(['vendor/exist' => new Link('test/test', 'vendor/exist', new Constraint('>=', '1.0'))]);
$rootPackage->setRequires(
['vendor/exist' => new Link('test/test', 'vendor/exist', new Constraint('>=', '1.0'))],
);
$this->composer = new Composer();
$this->composer->setConfig(new Config());
$this->composer->getConfig()->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/RemoveFromRequireTest.json'))
);
$this->composer->getConfig()
->setConfigSource(new JsonConfigSource(new JsonFile($this->tmpDir . '/RemoveFromRequireTest.json')));
$this->composer->setPackage($rootPackage);
$this->composer->getConfig()->getConfigSource()->addLink('require', 'vendor/exist', '^1.0');
$this->composer->getConfig()
->getConfigSource()
->addLink('require', 'vendor/exist', '^1.0');
}
protected function tearDown(): void
......@@ -75,7 +78,7 @@ class RemoveFromRequireTest extends TestCase
$actual = $operation->mark(new CollectionDummy(), $this->composer);
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -32,14 +32,18 @@ class RemoveFromSpipExtraExtensionsTest extends TestCase
$this->composer = new Composer();
$this->composer->setConfig(new Config());
$this->composer->getConfig()->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/RemoveFromSpipExtraExtensionsTest.json'))
);
$this->composer->getConfig()
->setConfigSource(
new JsonConfigSource(new JsonFile($this->tmpDir . '/RemoveFromSpipExtraExtensionsTest.json')),
);
$rootPackage = new RootPackage('test/test', '1', '1');
$this->composer->setPackage($rootPackage);
$this->composer->getConfig()->getConfigSource()->addProperty('extra.spip.extensions', ['vendor/exist']);
$this->composer->getPackage()->setExtra(['spip' => ['extensions' => ['vendor/exist']]]);
$this->composer->getConfig()
->getConfigSource()
->addProperty('extra.spip.extensions', ['vendor/exist']);
$this->composer->getPackage()
->setExtra(['spip' => ['extensions' => ['vendor/exist']]]);
}
protected function tearDown(): void
......@@ -72,7 +76,7 @@ class RemoveFromSpipExtraExtensionsTest extends TestCase
$actual = $operation->mark(new CollectionDummy(), $this->composer);
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -31,7 +31,10 @@ class RemoveSpecificationTest extends TestCase
$this->filesystem->emptyDirectory($this->tmpDir);
$this->collection = new CollectionMock($this->tmpDir . '/RemoveSpecificationTest.json');
$this->collection[] = new SpecificationMock('exist');
\file_put_contents($this->tmpDir . '/RemoveSpecificationTest.json', '{"exist":{"path":"path","source":"source","branch":"1.0"}}');
\file_put_contents(
$this->tmpDir . '/RemoveSpecificationTest.json',
'{"exist":{"path":"path","source":"source","branch":"1.0"}}',
);
}
protected function tearDown(): void
......@@ -51,7 +54,6 @@ class RemoveSpecificationTest extends TestCase
'expected' => OperationInterface::class,
'prefix' => 'exist',
],
];
}
......@@ -65,7 +67,7 @@ class RemoveSpecificationTest extends TestCase
$actual = $operation->mark($this->collection, $this->composer);
// Then
if (\is_null($expected)) {
if ($expected === null) {
$this->assertNull($actual);
} else {
$this->assertInstanceOf($expected, $actual);
......
......@@ -64,7 +64,7 @@ class SwitcherTest extends TestCase
// When
$switcher->to($operation);
foreach($switcher->flush(fn() => $this->composer) as $message) {
foreach ($switcher->flush(fn() => $this->composer) as $message) {
$actual[] = $message;
}
......