示例#1
0
 public function testInvalidPackage()
 {
     try {
         $this->app->getPackage('foobar');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\Phavour\\Application\\Exception\\PackageNotFoundException', $e);
         return;
     }
     $this->fail('expected exception');
 }
示例#2
0
文件: View.php 项目: phavour/phavour
 /**
  * Get the path for a view file.
  * @throws \Phavour\Application\Exception\PackageNotFoundException
  * @throws ViewFileNotFoundException
  * @return string
  */
 private function getPathForView()
 {
     $methodName = lcfirst($this->method);
     $className = lcfirst($this->class);
     $package = $this->app->getPackage($this->package);
     $pathPieces = array($package['package_path'], 'res', 'view', $className, $methodName);
     $path = implode(self::DS, $pathPieces) . '.phtml';
     if (file_exists($path)) {
         return $path;
     }
     $e = new ViewFileNotFoundException('Invalid view file path, expected: "' . $path . '"');
     $e->setAdditionalData('View Path Checked: ', $path);
     throw $e;
 }