Ejemplo n.º 1
0
 /**
  * @param Nette\Application\Request $appRequest
  * @return string
  */
 public function findPageObjectClass(Nette\Application\Request $appRequest = NULL)
 {
     if (!($appRequest = $appRequest ?: $this->getSession()->presenter())) {
         return NULL;
     }
     return $this->sitemap->findPageByPresenter($appRequest);
 }
Ejemplo n.º 2
0
 public function load(ContextInterface $context)
 {
     foreach ($this->sitemap->findClasses() as $className) {
         $reflection = new \ReflectionClass($className);
         if ($reflection->isSubclassOf('Behat\\Behat\\Context\\BehatContext')) {
             continue;
         }
         foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $methodRefl) {
             if ($methodRefl->getDeclaringClass() != $reflection) {
                 continue;
             }
             // only own methods; intentionally != because reflection is not identical
             foreach ($this->readMethodAnnotations($reflection->getName(), $methodRefl) as $annotation) {
                 if ($annotation instanceof \Behat\Behat\Definition\DefinitionInterface) {
                     $this->definitionDispatcher->addDefinition($annotation);
                 } elseif ($annotation instanceof \Behat\Behat\Definition\TransformationInterface) {
                     $this->definitionDispatcher->addTransformation($annotation);
                 } elseif ($annotation instanceof \Behat\Behat\Hook\HookInterface) {
                     $this->hookDispatcher->addHook($annotation);
                 }
             }
         }
     }
 }