Change default deb package name (#19)
* Change default deb package name Changed default deb package name to `"{$name}_{$version}_{$arch}.deb"` since this is what normally would be generated. * Fix tests for default deb name The tests with default package name still expected the old version of the name. * Fixed tests Tests tried to get the Control via `$this->getControl()` which obviously failed.
This commit is contained in:
parent
fe2ad18bb3
commit
22b2fcf742
|
@ -196,7 +196,11 @@ class Packager
|
|||
public function build($debPackageName = false)
|
||||
{
|
||||
if (!$debPackageName) {
|
||||
$debPackageName = basename($this->getOutputPath() . ".deb");
|
||||
$control = $this->getControl();
|
||||
$name = $control['Package'];
|
||||
$version = $control['Version'];
|
||||
$arch = $control['Architecture'];
|
||||
$debPackageName = "{$name}_{$version}_{$arch}.deb";
|
||||
}
|
||||
|
||||
$command = "dpkg -b {$this->getOutputPath()} {$debPackageName}";
|
||||
|
|
|
@ -57,8 +57,14 @@ class PackagerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->object->run();
|
||||
$command = $this->object->build();
|
||||
|
||||
$control = $this->object->getControl();
|
||||
$name = $control['Package'];
|
||||
$version = $control['Version'];
|
||||
$arch = $control['Architecture'];
|
||||
$debPackageName = "{$name}_{$version}_{$arch}.deb";
|
||||
|
||||
$this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command);
|
||||
$this->assertEquals("dpkg -b vfs://root/tmp {$debPackageName}", $command);
|
||||
}
|
||||
|
||||
public function testCreateDebWhenOutputFolderIsMissing()
|
||||
|
@ -72,8 +78,14 @@ class PackagerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->object->run();
|
||||
$command = $this->object->build();
|
||||
|
||||
$control = $this->object->getControl();
|
||||
$name = $control['Package'];
|
||||
$version = $control['Version'];
|
||||
$arch = $control['Architecture'];
|
||||
$debPackageName = "{$name}_{$version}_{$arch}.deb";
|
||||
|
||||
$this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command);
|
||||
$this->assertEquals("dpkg -b vfs://root/tmp {$debPackageName}", $command);
|
||||
}
|
||||
|
||||
public function testCreateDebPackageWithAnotherName()
|
||||
|
|
Loading…
Reference in a new issue