Captures current scenario title and path on scenario BEFORE event.

@param Event $event
193645
private function captureScenarioOnBeforeFeatureEvent(Event $event)
    {
        if (!$event instanceof BeforeScenarioTested) {
            return;
        }

        $this->scenarioTitle = sprintf('%s: %s', $event->getScenario()->getKeyword(), $event->getScenario()->getTitle());
        $this->scenarioPath = sprintf('%s:%s', $this->currentFeaturePath, $event->getScenario()->getLine());
    }
1232869
public function beforeExample(ScenarioTested $event)
    {
        $this->currentTestcase = $this->currentTestsuite->addChild('testcase');
        $this->currentTestcase->addAttribute('name', $this->currentOutlineTitle . ' Line #' . $event->getScenario()->getLine());

        $this->testcaseTimer->start();
    }
570929
public function beforeDispatch(Event $event)
    {
        $request = $event->getData('request');
        $response = $event->getData('response');
        $event->setData('controller', $this->_getController($request, $response));
    }
336589
private function captureOutlineOnBeforeOutlineEvent(Event $event)
    {
        if (!$event instanceof BeforeOutlineTested) {
            return;
        }

        $this->outline = $event->getOutline();
        $this->headerPrinted = false;
    }
439725
public function beforeRedirect(Event $event)
    {
        $subject = $event->getSubject();

        $redirects = $this->_action()->redirectConfig();
        if (empty($redirects)) {
            return;
        }

        foreach ($redirects as $redirect) {
            if (!$this->_getKey($subject, $redirect['reader'], $redirect['key'])) {
                continue;
            }

            $subject->url = $this->_getUrl($subject, $redirect['url']);
            break;
        }
    }
1271859
private function captureCurrentFeaturePathOnBeforeFeatureEvent(Event $event)
    {
        if (!$event instanceof BeforeFeatureTested) {
            return;
        }

        $this->currentFeaturePath = $event->getFeature()->getFile();
    }
1181748
public function afterSaveEvent($event)
    {
        if ($this->onlyRestScenarios) {
            if ($event->sender->scenario == ActiveController::SCENARIO_RESTCREATE || $event->sender->scenario == ActiveController::SCENARIO_RESTUPDATE) {
                $this->setRelation($event->sender->{$this->name}, $this->refJoinTable, $this->refModelPkId, $this->refJoinPkId, $event->sender->id);
            }
        } else {
            $this->setRelation($event->sender->{$this->name}, $this->refJoinTable, $this->refModelPkId, $this->refJoinPkId, $event->sender->id);
        }
    }
894660
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) : void
    {
        // @todo this will be removed once saved searches table schema is adjusted
        $saved = Hash::get($data, 'content.saved', []);
        if (! empty($saved)) {
            $data['content']['latest'] = $saved;
        }
    }
175863
protected function getEventOutput(Event $event)
    {
        if (! $event->output ||
            $event->output === $event->getDefaultOutput() ||
            $event->shouldAppendOutput ||
            ! file_exists($event->output)) {
            return '';
        }

        return trim(file_get_contents($event->output));
    }
1148441
public function afterFind($event)
    {
        foreach ($this->attributes as $attribute) {
            $this->owner->{$attribute} = $this->htmlEncode($this->owner->{$attribute});
        }
    }
761496
public function onViewBeforeRender(Event $event)
    {
        /**
         * @var Container $container
         * @var Profiler  $profiler
         */
        $container = $event['view']->getPackage()->getContainer();
        $profiler  = $container->get('profiler');

        $name = $event['view']->getPackage()->name . '@' . $event['view']->getName();

        $profiler->mark(__FUNCTION__ . ' / ' . $name . ' (' . uniqid() . ')', [
            'tag' => 'package.process',
        ]);
    }
1342644
public function beforeSave($event) {
		if ($this->getOwner()->getIsNewRecord() && ($this->createAttribute !== null)) {
			$this->getOwner()->{$this->createAttribute} = $this->getTimestampByAttribute($this->createAttribute);
		}
		if ((!$this->getOwner()->getIsNewRecord() || $this->setUpdateOnCreate) && ($this->updateAttribute !== null)) {
			$this->getOwner()->{$this->updateAttribute} = $this->getTimestampByAttribute($this->updateAttribute);
		}
	}
750795
private function captureStepEvent(Event $event)
    {
        if ($event instanceof AfterStepTested) {
            $this->afterStepTestedEvents[$event->getStep()->getLine()] = $event;
        }
        if ($event instanceof AfterStepSetup) {
            $this->afterStepSetupEvents[$event->getStep()->getLine()] = $event;
        }
    }
357749
public function beforePrepare(Event $event)
	{
		$command = $event['command'];

		if ($command->getName() !== 'createEntity') return;
		if (!$command['_id']) return;

		$operation = $command->getOperation();
		$operation->setHttpMethod('PUT');
	}
183935
private static function log_run_times_before_scenario( $event ) {
		$scenario_key = self::get_scenario_key( $event );
		if ( $scenario_key ) {
			self::$scenario_run_times[ $scenario_key ] = -microtime( true );
		}
	}
581135
private function getBasePath(Event $event)
    {
        $config = $event->getComposer()->getConfig();
        return realpath($config->get("vendor-dir") . "/../");
    }
1366640
public function beforeRender(Event $event)
    {
        $this->set('authUser', $this->authUser);
        $this->set('title', $this->name);

        $event = new Event('CakeAdmin.Controller.beforeRender', $this);
        EventManager::instance()->dispatch($event);
    }