Browse Source

Merge pull request #43 from Barbara-Pitt/config

issue#17 - unit tests - adding test for banners.php
pull/40/head
Barbara-Pitt 3 years ago
committed by GitHub
parent
commit
a90f36600f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      tests/bannersTest.php

24
tests/bannersTest.php

@ -0,0 +1,24 @@
<?php
use PHPUnit\Framework\TestCase;
ob_start();
require_once "banners.php";
ob_end_clean();
final class bannersTest extends TestCase
{
public function testBanners(){
$expected = '<a href="banners/lain-bottom.png"><img src="banners/lain-bottom.png" alt="lain-bottom.png" style="width:348px;height:128px"></a> ';
//capture input
ob_start();
listBannersInDir("banners");
$output = ob_get_contents();
ob_end_clean();
//end input
//assertion
$this->assertEquals($output,$expected);
}
}
Loading…
Cancel
Save