public function testCreateAndReadPackage() { $package_name = "Test" . time(); $package_version = "1.0.0"; $package = new PackageController($this->configuration(), $this->database()); $package->package = $package_name; $package->version = $package_version; $data = $package->persist(); $id = $data->id; $this->assertInstanceOf('Comodojo\\Package\\Controller', $data); $this->assertInternalType('int', $id); $packager = new PackageView($this->configuration); $packager->load($id); $this->assertEquals($package_name, $package->package); $this->assertEquals($package_version, $package->version); }
public function getPackage() { $package = new PackageView($this->configuration(), $this->database()); return $package->load($this->package); }