Completed
Pull Request — master (#586)
by Greg
03:34
created

ComposerTest::testComposerConfigCommand()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
use AspectMock\Test as test;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, test.

Let’s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let’s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
3
4
class ComposerTest extends \Codeception\TestCase\Test
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
5
{
6
    protected $container;
7
8
    /**
9
     * @var \AspectMock\Proxy\ClassProxy
10
     */
11
    protected $baseComposer;
12
13
    protected function _before()
14
    {
15
        $this->baseComposer = test::double('Robo\Task\Composer\Base', [
0 ignored issues
show
Documentation Bug introduced by
It seems like \AspectMock\Test::double...\Psr\Log\NullLogger())) can also be of type object<AspectMock\Proxy\InstanceProxy>. However, the property $baseComposer is declared as type object<AspectMock\Proxy\ClassProxy>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
16
            'output' => new \Symfony\Component\Console\Output\NullOutput(),
17
            'logger' => new \Psr\Log\NullLogger(),
18
        ]);
19
    }
20
    // tests
21 View Code Duplication
    public function testComposerInstall()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23
        $composer = test::double('Robo\Task\Composer\Install', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
24
25
        (new \Robo\Task\Composer\Install('composer'))->run();
26
        $composer->verifyInvoked('executeCommand', ['composer install --no-interaction']);
27
28
        (new \Robo\Task\Composer\Install('composer'))
29
            ->preferSource()
30
            ->run();
31
        $composer->verifyInvoked('executeCommand', ['composer install --prefer-source --no-interaction']);
32
33
        (new \Robo\Task\Composer\Install('composer'))
34
            ->optimizeAutoloader()
35
            ->run();
36
        $composer->verifyInvoked('executeCommand', ['composer install --optimize-autoloader --no-interaction']);
37
    }
38
39
    public function testComposerInstallAnsi()
40
    {
41
        $config = new \Robo\Config();
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
42
        $config->setDecorated(true);
43
        $config->setInteractive(true);
44
        $composer = test::double('Robo\Task\Composer\Install', ['executeCommand' => null, 'getConfig' => $config, 'logger' => new \Psr\Log\NullLogger()]);
45
46
        (new \Robo\Task\Composer\Install('composer'))->run();
47
        $composer->verifyInvoked('executeCommand', ['composer install --ansi']);
48
49
        (new \Robo\Task\Composer\Install('composer'))
50
            ->preferSource()
51
            ->run();
52
        $composer->verifyInvoked('executeCommand', ['composer install --prefer-source --ansi']);
53
54
        (new \Robo\Task\Composer\Install('composer'))
55
            ->optimizeAutoloader()
56
            ->run();
57
        $composer->verifyInvoked('executeCommand', ['composer install --optimize-autoloader --ansi']);
58
    }
59
60 View Code Duplication
    public function testComposerUpdate()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
61
    {
62
        $composer = test::double('Robo\Task\Composer\Update', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
63
64
        (new \Robo\Task\Composer\Update('composer'))->run();
65
        $composer->verifyInvoked('executeCommand', ['composer update --no-interaction']);
66
67
        (new \Robo\Task\Composer\Update('composer'))
68
            ->optimizeAutoloader()
69
            ->run();
70
        $composer->verifyInvoked('executeCommand', ['composer update --optimize-autoloader --no-interaction']);
71
    }
72
73
    public function testComposerDumpAutoload()
74
    {
75
        $composer = test::double('Robo\Task\Composer\DumpAutoload', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
76
77
        (new \Robo\Task\Composer\DumpAutoload('composer'))->run();
78
        $composer->verifyInvoked('executeCommand', ['composer dump-autoload --no-interaction']);
79
80
        (new \Robo\Task\Composer\DumpAutoload('composer'))
81
            ->noDev()
82
            ->run();
83
        $composer->verifyInvoked('executeCommand', ['composer dump-autoload --no-dev --no-interaction']);
84
85
        (new \Robo\Task\Composer\DumpAutoload('composer'))
86
            ->optimize()
87
            ->run();
88
        $composer->verifyInvoked('executeCommand', ['composer dump-autoload --optimize --no-interaction']);
89
90
        (new \Robo\Task\Composer\DumpAutoload('composer'))
91
            ->optimize()
92
            ->noDev()
93
            ->run();
94
        $composer->verifyInvoked('executeCommand', ['composer dump-autoload --optimize --no-dev --no-interaction']);
95
    }
96
97
    public function testComposerValidate()
98
    {
99
        $composer = test::double('Robo\Task\Composer\Validate', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]);
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
100
101
        (new \Robo\Task\Composer\Validate('composer'))->run();
102
        $composer->verifyInvoked('executeCommand', ['composer validate --no-interaction']);
103
104
        (new \Robo\Task\Composer\Validate('composer'))
105
            ->noCheckAll()
106
            ->run();
107
        $composer->verifyInvoked('executeCommand', ['composer validate --no-check-all --no-interaction']);
108
109
        (new \Robo\Task\Composer\Validate('composer'))
110
            ->noCheckLock()
111
            ->run();
112
        $composer->verifyInvoked('executeCommand', ['composer validate --no-check-lock --no-interaction']);
113
114
        (new \Robo\Task\Composer\Validate('composer'))
115
            ->noCheckPublish()
116
            ->run();
117
        $composer->verifyInvoked('executeCommand', ['composer validate --no-check-publish --no-interaction']);
118
119
        (new \Robo\Task\Composer\Validate('composer'))
120
            ->withDependencies()
121
            ->run();
122
        $composer->verifyInvoked('executeCommand', ['composer validate --with-dependencies --no-interaction']);
123
124
        (new \Robo\Task\Composer\Validate('composer'))
125
            ->strict()
126
            ->run();
127
        $composer->verifyInvoked('executeCommand', ['composer validate --strict --no-interaction']);
128
    }
129
130
    public function testComposerInstallCommand()
131
    {
132
        verify(
133
            (new \Robo\Task\Composer\Install('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
134
        )->equals('composer install --no-interaction');
135
136
        verify(
137
            (new \Robo\Task\Composer\Install('composer'))
138
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
139
                ->noDev()
140
                ->preferDist()
141
                ->optimizeAutoloader()
142
                ->getCommand()
143
        )->equals('composer install --optimize-autoloader --prefer-dist --no-dev --no-interaction');
144
    }
145
146
    public function testComposerUpdateCommand()
147
    {
148
        verify(
149
            (new \Robo\Task\Composer\Update('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
150
        )->equals('composer update --no-interaction');
151
152
        verify(
153
            (new \Robo\Task\Composer\Update('composer'))
154
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
155
                ->noDev()
156
                ->preferDist()
157
                ->getCommand()
158
        )->equals('composer update --prefer-dist --no-dev --no-interaction');
159
160
        verify(
161
            (new \Robo\Task\Composer\Update('composer'))
162
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
163
                ->noDev()
164
                ->preferDist()
165
                ->optimizeAutoloader()
166
                ->getCommand()
167
        )->equals('composer update --optimize-autoloader --prefer-dist --no-dev --no-interaction');
168
    }
169
170
    public function testComposerDumpAutoloadCommand()
171
    {
172
        verify(
173
            (new \Robo\Task\Composer\DumpAutoload('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
174
        )->equals('composer dump-autoload --no-interaction');
175
176
        verify(
177
            (new \Robo\Task\Composer\DumpAutoload('composer'))
178
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
179
                ->noDev()
180
                ->getCommand()
181
        )->equals('composer dump-autoload --no-dev --no-interaction');
182
183
        verify(
184
            (new \Robo\Task\Composer\DumpAutoload('composer'))
185
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
186
                ->optimize()
187
                ->getCommand()
188
        )->equals('composer dump-autoload --optimize --no-interaction');
189
190
        verify(
191
            (new \Robo\Task\Composer\DumpAutoload('composer'))
192
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
193
                ->optimize()
194
                ->noDev()
195
                ->getCommand()
196
        )->equals('composer dump-autoload --optimize --no-dev --no-interaction');
197
    }
198
199
    public function testComposerRemove()
200
    {
201
        verify(
202
            (new \Robo\Task\Composer\Remove('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
203
        )->equals('composer remove --no-interaction');
204
        verify(
205
            (new \Robo\Task\Composer\Remove('composer'))
206
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
207
                ->dev()
208
                ->noProgress()
209
                ->noUpdate()
210
                ->getCommand()
211
        )->equals('composer remove --dev --no-progress --no-update --no-interaction');
212
    }
213
214
    public function testComposerValidateCommand()
215
    {
216
        verify(
217
            (new \Robo\Task\Composer\Validate('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
218
        )->equals('composer validate --no-interaction');
219
220
        verify(
221
            (new \Robo\Task\Composer\Validate('composer'))
222
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
223
                ->noCheckAll()
224
                ->getCommand()
225
        )->equals('composer validate --no-check-all --no-interaction');
226
227
        verify(
228
            (new \Robo\Task\Composer\Validate('composer'))
229
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
230
                ->noCheckLock()
231
                ->getCommand()
232
        )->equals('composer validate --no-check-lock --no-interaction');
233
234
        verify(
235
            (new \Robo\Task\Composer\Validate('composer'))
236
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
237
                ->noCheckPublish()
238
                ->getCommand()
239
        )->equals('composer validate --no-check-publish --no-interaction');
240
241
        verify(
242
            (new \Robo\Task\Composer\Validate('composer'))
243
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
244
                ->withDependencies()
245
                ->getCommand()
246
        )->equals('composer validate --with-dependencies --no-interaction');
247
248
        verify(
249
            (new \Robo\Task\Composer\Validate('composer'))
250
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
251
                ->strict()
252
                ->getCommand()
253
        )->equals('composer validate --strict --no-interaction');
254
255
        verify(
256
            (new \Robo\Task\Composer\Validate('composer'))
257
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
258
                ->noCheckAll()
259
                ->noCheckLock()
260
                ->noCheckPublish()
261
                ->withDependencies()
262
                ->strict()
263
                ->getCommand()
264
        )->equals('composer validate --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict --no-interaction');
265
    }
266
267
    public function testComposerInitCommand()
268
    {
269
        verify(
270
            (new \Robo\Task\Composer\Init('composer'))->setConfig(new \Robo\Config())->getCommand()
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
271
        )->equals('composer init --no-interaction');
272
273
        verify(
274
            (new \Robo\Task\Composer\Init('composer'))
275
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
276
                ->projectName('foo/bar')
277
                ->description('A test project')
278
                ->dependency('baz/boz', '^2.4.8')
279
                ->projectType('project')
280
                ->homepage('https://foo.bar.com')
281
                ->stability('beta')
282
                ->license('MIT')
283
                ->repository('https://packages.drupal.org/8')
284
                ->getCommand()
285
        )->equals("composer init --name foo/bar --description 'A test project' --require 'baz/boz:^2.4.8' --type project --homepage 'https://foo.bar.com' --stability beta --license MIT --repository 'https://packages.drupal.org/8' --no-interaction");
286
287
    }
288
289
    public function testComposerConfigCommand()
290
    {
291
        verify(
292
            (new \Robo\Task\Composer\Config('composer'))
293
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
294
                ->set('bin-dir', 'bin/')
295
                ->getCommand()
296
        )->equals("composer config bin-dir bin/ --no-interaction");
297
298
        verify(
299
            (new \Robo\Task\Composer\Config('composer'))
300
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
301
                ->useGlobal()
302
                ->set('bin-dir', 'bin/')
303
                ->getCommand()
304
        )->equals("composer config --global bin-dir bin/ --no-interaction");
305
306
        verify(
307
            (new \Robo\Task\Composer\Config('composer'))
308
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
309
                ->repository('drupalorg', 'https://packages.drupal.org/8', 'composer')
310
                ->getCommand()
311
        )->equals("composer config repositories.drupalorg composer 'https://packages.drupal.org/8' --no-interaction");
312
    }
313
314
    public function testComposerRequireCommand()
315
    {
316
        verify(
317
            (new \Robo\Task\Composer\RequireDependency('composer'))
318
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
319
                ->dependency('foo/bar', '^2.4.8')
320
                ->getCommand()
321
        )->equals("composer require 'foo/bar:^2.4.8' --no-interaction");
322
    }
323
324
    public function testComposerCreateProjectCommand()
325
    {
326
        verify(
327
            (new \Robo\Task\Composer\CreateProject('composer'))
328
                ->setConfig(new \Robo\Config())
0 ignored issues
show
Deprecated Code introduced by
The class Robo\Config has been deprecated with message: Use \Robo\Config\Config

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
329
                ->source('foo/bar')
330
                ->version('^2.4.8')
331
                ->target('mybar')
332
                ->repository('https://packages.drupal.org/8')
333
                ->keepVcs()
334
                ->noInstall()
335
                ->getCommand()
336
        )->equals("composer create-project --repository 'https://packages.drupal.org/8' --keep-vcs --no-install foo/bar mybar '^2.4.8' --no-interaction");
337
    }
338
}
339