Skip to content

Commit 84ce9f4

Browse files
Add tests for php versions project generation.
1 parent f270c87 commit 84ce9f4

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

tests/ConstructTest.php

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function testProjectGenerationWithEditorConfig()
332332
$this->assertSame($this->getStub('with-editorconfig/gitattributes'), $this->getFile('.gitattributes'));
333333
}
334334

335-
public function testProjectGenerationWithSpecifiedPhpVersion()
335+
public function testProjectGenerationWithPhp54()
336336
{
337337
$settings = new Settings(
338338
'jonathantorres/logger',
@@ -349,7 +349,71 @@ public function testProjectGenerationWithSpecifiedPhpVersion()
349349
);
350350

351351
$this->construct->generate($settings, $this->gitHelper, $this->scriptHelper);
352-
$this->assertSame($this->getStub('composer.phpversion'), $this->getFile('composer.json'));
352+
$this->assertSame($this->getStub('composer.php54'), $this->getFile('composer.json'));
353+
$this->assertSame($this->getStub('travis.php54'), $this->getFile('.travis.yml'));
354+
}
355+
356+
public function testProjectGenerationWithPhp55()
357+
{
358+
$settings = new Settings(
359+
'jonathantorres/logger',
360+
'phpunit',
361+
'MIT',
362+
'Vendor\Project',
363+
null,
364+
null,
365+
null,
366+
null,
367+
null,
368+
'5.5.0',
369+
null
370+
);
371+
372+
$this->construct->generate($settings, $this->gitHelper, $this->scriptHelper);
373+
$this->assertSame($this->getStub('composer.php55'), $this->getFile('composer.json'));
374+
$this->assertSame($this->getStub('travis.php55'), $this->getFile('.travis.yml'));
375+
}
376+
377+
public function testProjectGenerationWithPhp56()
378+
{
379+
$settings = new Settings(
380+
'jonathantorres/logger',
381+
'phpunit',
382+
'MIT',
383+
'Vendor\Project',
384+
null,
385+
null,
386+
null,
387+
null,
388+
null,
389+
'5.6.0',
390+
null
391+
);
392+
393+
$this->construct->generate($settings, $this->gitHelper, $this->scriptHelper);
394+
$this->assertSame($this->getStub('composer.php56'), $this->getFile('composer.json'));
395+
$this->assertSame($this->getStub('travis.php56'), $this->getFile('.travis.yml'));
396+
}
397+
398+
public function testProjectGenerationWithPhp7()
399+
{
400+
$settings = new Settings(
401+
'jonathantorres/logger',
402+
'phpunit',
403+
'MIT',
404+
'Vendor\Project',
405+
null,
406+
null,
407+
null,
408+
null,
409+
null,
410+
'7.0.0',
411+
null
412+
);
413+
414+
$this->construct->generate($settings, $this->gitHelper, $this->scriptHelper);
415+
$this->assertSame($this->getStub('composer.php7'), $this->getFile('composer.json'));
416+
$this->assertSame($this->getStub('travis.php7'), $this->getFile('.travis.yml'));
353417
}
354418

355419
public function testProjectGenerationWithEnvironmentFiles()

0 commit comments

Comments
 (0)