/** * Test urlList() * * @return void */ public function testUrlList() { $check = []; foreach ($this->test_urls as $url => $result) { if ($result) { $check[] = $url; } } foreach ($this->short_url->urlList() as $item) { $this->assertContains($item["url"], $check); } }
<h1>ShortURL</h1> <p>短縮したURL一覧</p> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>ShortURL</th> <th>LongURL</th> </tr> </thead> <tbody> <?php $i = 1; $base = config("url"); foreach ($ShortURL->urlList() as $row) { $url = "/" . $row["id"]; ?> <tr> <th><?php echo h($i); ?> </th> <th><a href="<?php echo h($url); ?> "><?php echo h($base . $url); ?> </a></th> <th><a href="<?php