function setUp()
 {
     // Mock the post request.
     $request = new Request([], ['worked' => 10]);
     RequestWrapper::inject($request);
     SessionFactory::init(new MockArraySessionStorage());
 }
示例#2
0
 public function setUp()
 {
     // Mock the post request.
     $session = SessionFactory::init(new MockArraySessionStorage());
     $this->char = TestAccountCreateAndDestroy::char();
     $session->set('player_id', $this->char->id());
 }
示例#3
0
 public function setUp()
 {
     parent::setUp();
     SessionFactory::init(new MockArraySessionStorage());
     $char_id = TestAccountCreateAndDestroy::create_testing_account();
     SessionFactory::getSession()->set('player_id', $char_id);
 }
 protected function setUp()
 {
     $this->markTestIncomplete('Casino index relies on DB to get player');
     SessionFactory::init(new MockArraySessionStorage());
     $char_id = TestAccountCreateAndDestroy::create_testing_account();
     SessionFactory::getSession()->set('player_id', $char_id);
 }
 function setUp()
 {
     // Mock the post request.
     $request = new Request([], ['purchase' => 1, 'quantity' => 2, 'item' => 'Shuriken']);
     RequestWrapper::inject($request);
     SessionFactory::init(new MockArraySessionStorage());
 }
 public function setUp()
 {
     parent::setUp();
     // Mock the post request.
     $request = new Request([], []);
     RequestWrapper::inject($request);
     SessionFactory::init(new MockArraySessionStorage());
 }
示例#7
0
 /**
  * Create a mock login, with real created account and character
  */
 public function login()
 {
     SessionFactory::init(new MockArraySessionStorage());
     $this->char = TestAccountCreateAndDestroy::char();
     SessionFactory::getSession()->set('authenticated', true);
     $this->account = Account::findByChar($this->char);
     SessionFactory::getSession()->set('account_id', $this->account->id());
 }
示例#8
0
 public function setUp()
 {
     parent::setUp();
     SessionFactory::init(new MockArraySessionStorage());
     $char_id = TestAccountCreateAndDestroy::create_testing_account();
     SessionFactory::getSession()->set('player_id', $char_id);
     $this->clan = Clan::create(Player::find($char_id), 'phpunit_test_clan');
 }
 function setUp()
 {
     $this->char = TestAccountCreateAndDestroy::char();
     $request = new Request([], []);
     RequestWrapper::inject($request);
     SessionFactory::init(new MockArraySessionStorage());
     $sess = SessionFactory::getSession();
     $sess->set('player_id', $this->char->id());
 }
 protected function setUp()
 {
     $this->markTestIncomplete('AccountController::render relies on the DB.');
     SessionFactory::init(new MockArraySessionStorage());
     $get = ['command' => 'change'];
     $request = new Request($get);
     RequestWrapper::inject($request);
     // Pass a request to be used by tests
 }
示例#11
0
 protected function setUp()
 {
     $this->char = TestAccountCreateAndDestroy::char();
     SessionFactory::init(new MockArraySessionStorage());
     SessionFactory::getSession()->set('player_id', $this->char->id());
     $this->controller = new NpcController(['randomness' => function () {
         return 0;
     }]);
 }
示例#12
0
 public function setUp()
 {
     parent::setUp();
     SessionFactory::init(new MockArraySessionStorage());
     $char_id = TestAccountCreateAndDestroy::create_testing_account();
     SessionFactory::getSession()->set('player_id', $char_id);
     $request = new Request([], []);
     RequestWrapper::inject($request);
 }
示例#13
0
 /**
  */
 protected function setUp()
 {
     // Mock the post request.
     $request = new Request([], []);
     RequestWrapper::inject($request);
     $this->char_id = TestAccountCreateAndDestroy::create_testing_account();
     $session = SessionFactory::init(new MockArraySessionStorage());
     $session->set('player_id', $this->char_id);
     $session->set('account_id', $this->char_id);
 }
示例#14
0
 public function setUp()
 {
     $this->char = Player::find(TestAccountCreateAndDestroy::char_id());
     SessionFactory::init(new MockArraySessionStorage());
     $session = SessionFactory::getSession();
     $session->set('player_id', $this->char->id());
     // Mock the login.
     $request = new Request([], []);
     RequestWrapper::inject($request);
 }
示例#15
0
 function setUp()
 {
     $_SERVER['REMOTE_ADDR'] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
     $this->test_email = TestAccountCreateAndDestroy::$test_email;
     // Something@example.com probably
     $this->test_password = TestAccountCreateAndDestroy::$test_password;
     $this->test_ninja_name = TestAccountCreateAndDestroy::$test_ninja_name;
     TestAccountCreateAndDestroy::purge_test_accounts($this->test_ninja_name);
     $this->test_ninja_id = TestAccountCreateAndDestroy::create_testing_account();
     SessionFactory::init(new MockArraySessionStorage());
 }
 function setUp()
 {
     $this->controller = new InventoryController();
     $this->char = TestAccountCreateAndDestroy::char();
     $request = new Request([], []);
     RequestWrapper::inject($request);
     SessionFactory::init(new MockArraySessionStorage());
     $sess = SessionFactory::getSession();
     $sess->set('player_id', $this->char->id());
     add_item($this->char->id(), self::ITEM);
 }
 public function setUp()
 {
     SessionFactory::init(new MockArraySessionStorage());
     $char_id = TestAccountCreateAndDestroy::char_id();
     $char = Player::find($char_id);
     $account = Account::findByChar($char);
     $account_id = $account->id();
     SessionFactory::getSession()->set('authenticated', true);
     SessionFactory::getSession()->set('player_id', $char_id);
     SessionFactory::getSession()->set('account_id', $account_id);
 }
示例#18
0
 protected function setUp()
 {
     $this->char = TestAccountCreateAndDestroy::char();
     SessionFactory::init(new MockArraySessionStorage());
 }
示例#19
0
 public function setUp()
 {
     SessionFactory::init(new MockArraySessionStorage());
 }
 public function testGetSession()
 {
     $this->session = SessionFactory::init(new MockArraySessionStorage());
     $this->assertSame($this->session, SessionFactory::getSession());
     $this->session->invalidate();
 }
 function setUp()
 {
     // Mock the post request.
     SessionFactory::init(new MockArraySessionStorage());
 }