Example #1
0
 /**
  * Persist all and destroy the persistence session for the next test
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function tearDown()
 {
     try {
         parent::tearDown();
     } catch (\Exception $e) {
         \TYPO3\Flow\var_dump($e, 'Exception during tearDown');
     }
     $this->tearDownPersistence();
 }
 /**
  *
  */
 public function allCommand()
 {
     $fullAmount = 500;
     $currentSlot = 0;
     $perRun = 10;
     while ($currentSlot <= $fullAmount) {
         $this->getReviewBlock($currentSlot, $perRun);
         $currentSlot = $currentSlot + $perRun;
     }
     \TYPO3\Flow\var_dump($this->counter);
 }
 /**
  * Wrapper for \TYPO3\Flow\var_dump()
  *
  * @param string $title
  * @param boolean $typeOnly Whether only the type should be returned instead of the whole chain.
  * @return string debug string
  */
 public function render($title = NULL, $typeOnly = FALSE)
 {
     $expressionToExamine = $this->renderChildren();
     if ($typeOnly === TRUE && $expressionToExamine !== NULL) {
         $expressionToExamine = is_object($expressionToExamine) ? get_class($expressionToExamine) : gettype($expressionToExamine);
     }
     ob_start();
     \TYPO3\Flow\var_dump($expressionToExamine, $title);
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
 /**
  * Return the values in a human readable form
  *
  * @return void|string
  */
 public function evaluate()
 {
     $title = $this->getTitle();
     $plaintext = $this->getPlaintext();
     $debugData = array();
     foreach (array_keys($this->properties) as $key) {
         if (in_array($key, $this->ignoreProperties)) {
             continue;
         }
         $debugData[$key] = $this->tsValue($key);
     }
     if (count($debugData) === 0) {
         $debugData = null;
     } elseif (array_key_exists('value', $debugData) && count($debugData) === 1) {
         $debugData = $debugData['value'];
     }
     return \TYPO3\Flow\var_dump($debugData, $title, true, $plaintext);
 }
Example #5
0
 /**
  * Executes this finisher
  * @see AbstractFinisher::execute()
  *
  * @return void
  * @throws \TYPO3\Form\Exception\FinisherException
  */
 protected function executeInternal()
 {
     $formRuntime = $this->finisherContext->getFormRuntime();
     $standaloneView = $this->initializeStandaloneView();
     $standaloneView->assign('form', $formRuntime);
     $message = $standaloneView->render();
     $subject = $this->parseOption('subject');
     $recipientAddress = $this->parseOption('recipientAddress');
     $recipientName = $this->parseOption('recipientName');
     $senderAddress = $this->parseOption('senderAddress');
     $senderName = $this->parseOption('senderName');
     $replyToAddress = $this->parseOption('replyToAddress');
     $format = $this->parseOption('format');
     $testMode = $this->parseOption('testMode');
     if ($subject === NULL) {
         throw new \TYPO3\Form\Exception\FinisherException('The option "subject" must be set for the EmailFinisher.', 1327060320);
     }
     if ($recipientAddress === NULL) {
         throw new \TYPO3\Form\Exception\FinisherException('The option "recipientAddress" must be set for the EmailFinisher.', 1327060200);
     }
     if ($senderAddress === NULL) {
         throw new \TYPO3\Form\Exception\FinisherException('The option "senderAddress" must be set for the EmailFinisher.', 1327060210);
     }
     $mail = new \TYPO3\SwiftMailer\Message();
     $mail->setFrom(array($senderAddress => $senderName))->setTo(array($recipientAddress => $recipientName))->setSubject($subject);
     if ($replyToAddress !== NULL) {
         $mail->setReplyTo($replyToAddress);
     }
     if ($format === self::FORMAT_PLAINTEXT) {
         $mail->setBody($message, 'text/plain');
     } else {
         $mail->setBody($message, 'text/html');
     }
     if ($testMode === TRUE) {
         \TYPO3\Flow\var_dump(array('sender' => array($senderAddress => $senderName), 'recipient' => array($recipientAddress => $recipientName), 'replyToAddress' => $replyToAddress, 'message' => $message, 'format' => $format), 'E-Mail "' . $subject . '"');
     } else {
         $mail->send();
     }
 }
 /**
  * save the registration
  * @param string $name
  * @param string $pass
  * @param string $pass2
  * @param string $role
  */
 public function createAction($name, $pass, $pass2, $role)
 {
     if ($name == '' || strlen($name) < 3) {
         $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error('Username too short or empty'));
         $this->redirect('register', 'Login');
     } else {
         if ($pass == '' || $pass != $pass2) {
             $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error('Password too short or does not match'));
             $this->redirect('register', 'Login');
         } else {
             // create a account with password an add it to the accountRepository
             $account = $this->accountFactory->createAccountWithPassword($name, $pass, array($role));
             $this->userRepository->add($account);
             $this->accountRepository->add($account);
             \TYPO3\Flow\var_dump($this->userRepository->findAll());
             die;
             // add a message and redirect to the login form
             $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error('Account created. Please login.'));
             $this->redirect('index');
         }
     }
     // redirect to the login form
     $this->redirect('index', 'Login');
 }
 /**
  * @param array $labels
  * @throws \Exception
  * @return array
  */
 protected function extractLabels(array $labels)
 {
     $out = ['positive_reviews' => 0, 'negative_reviews' => 0, 'positive_verifications' => 0, 'negative_verifications' => 0];
     foreach ($labels as $labelType => $subrow) {
         switch ($labelType) {
             case 'Verified':
                 $key = '_verifications';
                 break;
             case 'Code-Review':
                 $key = '_reviews';
                 break;
             default:
                 throw new \Exception('Unknown Label type ' . $labelType);
         }
         foreach ($subrow as $reviewType => $amount) {
             switch ($reviewType) {
                 case 'approved':
                     $out['positive' . $key] = $out['positive' . $key] + count($amount) * 2;
                     break;
                 case 'recommended':
                     $out['positive' . $key] = $out['positive' . $key] + count($amount) * 1;
                     break;
                 case 'rejected':
                     $out['negative' . $key] = $out['negative' . $key] + count($amount) * 2;
                     break;
                 case 'disliked':
                     $out['negative' . $key] = $out['negative' . $key] + count($amount) * 1;
                     break;
                     /**
                      * Value is passed in a strange way, we just ignore it
                      */
                 /**
                  * Value is passed in a strange way, we just ignore it
                  */
                 case 'value':
                     break;
                 case 'blocking':
                     break;
                 default:
                     \TYPO3\Flow\var_dump($subrow);
                     throw new \Exception('Unknown Review Type ' . $labelType . ':' . $reviewType);
             }
         }
     }
     return $out;
 }
Example #8
0
 /**
  * Fetches the profile attached to the profiling run and var_dumps it.
  *
  * @param string $runIdentifier
  * @return string
  */
 public function xhprofDebugAction($runIdentifier)
 {
     $profile = $this->getProfile($runIdentifier);
     \TYPO3\Flow\var_dump($profile->getXhprofTrace());
     return '';
 }
 /**
  * Update the page https://forge.typo3.org/projects/typo3cms-core/wiki/Forgertest
  * @deprecated Not usable because our redmine is too old
  * @param string $content
  * @param string $project
  * @param string $page
  */
 protected function updateWikiPage($content, $project = 'typo3cms-core', $page = 'Mergedorphans')
 {
     //content[text]
     //content[comments]
     $user = $this->settings['Gerrit']['username'];
     $pass = $this->settings['Gerrit']['password'];
     $browser = new Client\Browser();
     $engine = new Client\CurlEngine();
     $browser->setRequestEngine($engine);
     $res = $browser->request('https://' . $user . ':' . $pass . '@forge.typo3.org/projects/' . $project . '/wiki/' . $page . '/', 'PUT', array(), array(), array('PHP_AUTH_USER' => $user, 'PHP_AUTH_PW' => $pass), 'content[text]=' . rawurlencode($content) . '&commit=Save');
     \TYPO3\Flow\var_dump($res);
 }
Example #10
0
 public function debug()
 {
     \TYPO3\Flow\var_dump($this->response);
     return $this;
 }