/** * */ 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); }
<?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 /> ©NK.pl 2012 </body> </html>