Exemplo n.º 1
0
 /**
  * @testdox  Tests that a JUser object is injected into the application.
  *
  * @covers  JApplicationBase::loadIdentity
  */
 public function testLoadIdentityWithInjectedUser()
 {
     $mockUser = $this->getMock('JUser');
     // Validate method chaining
     $this->assertSame($this->class, $this->class->loadIdentity($mockUser));
     $this->assertAttributeSame($mockUser, 'identity', $this->class);
 }
Exemplo n.º 2
0
 /**
  * Tests the JApplicationBase::loadIdentity and JApplicationBase::getIdentity methods.
  *
  * @return  void
  *
  * @since   12.3
  */
 public function testLoadGetIdentity99()
 {
     // Mock the session.
     JFactory::$session = $this->getMockSession(array('get.user.id' => 99));
     $this->class->loadIdentity();
     $this->assertEquals(99, TestReflection::getValue($this->class, 'identity')->get('id'));
 }