test_base.php 514 B

123456789101112131415161718192021222324
  1. <?php
  2. require_once 'base.php';
  3. use webbasics\Base;
  4. class BaseExtension extends Base {
  5. function __construct($foo, $bar) {
  6. $this->foo = $foo;
  7. $this->bar = $bar;
  8. }
  9. }
  10. class BaseTest extends PHPUnit_Framework_TestCase {
  11. function testCreate() {
  12. $this->assertEquals(BaseExtension::create('a', 'b'), new BaseExtension('a', 'b'));
  13. }
  14. function testPathWithSlash() {
  15. $this->assertEquals(Base::pathWithSlash('dirname'), 'dirname/');
  16. $this->assertEquals(Base::pathWithSlash('dirname/'), 'dirname/');
  17. }
  18. }
  19. ?>