Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class PhabricatorPhortuneTestCase extends PhabricatorTestCase { protecte..

Decoded Output download

<?php

final class PhabricatorPhortuneTestCase
  extends PhabricatorTestCase {

  protected function getPhabricatorTestCaseConfiguration() {
    return array(
      self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
    );
  }

  public function testNewPhortuneAccount() {
    $user = $this->generateNewTestUser();
    $content_source = $this->newContentSource();

    $accounts = PhortuneAccountQuery::loadAccountsForUser(
      $user,
      $content_source);

    $this->assertEqual(
      1,
      count($accounts),
      pht('Creation of default account for users with no accounts.'));

    // Reload the account. The user should be able to view and edit it, and
    // should be a member.

    $account = head($accounts);
    $account = id(new PhortuneAccountQuery())
      ->setViewer($user)
      ->withPHIDs(array($account->getPHID()))
      ->requireCapabilities(
        array(
          PhabricatorPolicyCapability::CAN_VIEW,
          PhabricatorPolicyCapability::CAN_EDIT,
        ))
      ->executeOne();

    $this->assertEqual(true, ($account instanceof PhortuneAccount));
    $this->assertEqual(array($user->getPHID()), $account->getMemberPHIDs());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorPhortuneTestCase
  extends PhabricatorTestCase {

  protected function getPhabricatorTestCaseConfiguration() {
    return array(
      self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
    );
  }

  public function testNewPhortuneAccount() {
    $user = $this->generateNewTestUser();
    $content_source = $this->newContentSource();

    $accounts = PhortuneAccountQuery::loadAccountsForUser(
      $user,
      $content_source);

    $this->assertEqual(
      1,
      count($accounts),
      pht('Creation of default account for users with no accounts.'));

    // Reload the account. The user should be able to view and edit it, and
    // should be a member.

    $account = head($accounts);
    $account = id(new PhortuneAccountQuery())
      ->setViewer($user)
      ->withPHIDs(array($account->getPHID()))
      ->requireCapabilities(
        array(
          PhabricatorPolicyCapability::CAN_VIEW,
          PhabricatorPolicyCapability::CAN_EDIT,
        ))
      ->executeOne();

    $this->assertEqual(true, ($account instanceof PhortuneAccount));
    $this->assertEqual(array($user->getPHID()), $account->getMemberPHIDs());
  }

}

Function Calls

None

Variables

None

Stats

MD5 87a4ee657ec06ef1acb6a355812e0230
Eval Count 0
Decode Time 94 ms