Exemplo n.º 1
0
 /**
  *
  */
 public function testButton()
 {
     $s = array('HTTPS' => 'on', 'HTTP_HOST' => 'localhost', 'REQUEST_URI' => '/some/path.php?aaa=bbb', 'REQUEST_METHOD' => 'POST');
     $ss = array('nkconnect_some_key_otp' => 'aaaa_bbbb_ccc');
     $this->request->expects($this->any())->method('getServerData')->will($this->returnValue($s));
     $this->request->expects($this->any())->method('getSessionData')->will($this->returnValue($ss));
     $result = $this->object->button();
     $this->assertTag(array('tag' => 'a'), $result);
     $this->assertTag(array('tag' => 'img'), $result);
     $this->assertContains('some_key', $result);
     $this->assertContains(rawurlencode('https://localhost/some/path.php?aaa=bbb&nkconnect_state=callback'), $result);
     $this->assertContains('aaaa_bbbb_ccc', $result);
 }
Exemplo n.º 2
0
    <?php 
if ($auth->authenticated()) {
    ?>
      Jesteś zalogowany jako <?php 
    echo htmlspecialchars($auth->user()->name());
    ?>
.<br />
      <img src="<?php 
    echo $auth->user()->thumbnailUrl();
    ?>
"  alt="Thumb"/><br />
      <a href="<?php 
    echo $auth->logoutLink();
    ?>
">Wyloguj</a>
    <?php 
} else {
    ?>
      <?php 
    echo $auth->button();
    ?>
    <?php 
}
?>

    <br />
    <br />
    &copy;NK.pl 2012
  </body>
</html>