Skip to content

Commit

Permalink
moved BookControl2 into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
konecnyjakub committed Nov 15, 2016
1 parent 07c7a4f commit 3487329
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -36,6 +36,11 @@
"Nexendrie\\BookComponent\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Nexendrie\\BookComponent\\": "tests/"
}
},
"replace": {
"konecnyjakub/book-component": "~1.0"
},
Expand Down
27 changes: 27 additions & 0 deletions tests/Nexendrie/BookComponent/BookControl2.php
@@ -0,0 +1,27 @@
<?php
namespace Nexendrie\BookComponent;

class BookControl2 extends BookControl {
function __construct() {
parent::__construct("Test", __DIR__);
}

/**
* @return BookPagesStorage
*/
function getPages() {
$storage = new BookPagesStorage;
$storage[] = new BookPage("slug1", "title1");
$storage[] = new BookPage("slug2", "title2");
$storage[] = new BookPage("slug3", "title3");
return $storage;
}

/**
* @return void
*/
function renderSlug1() {
$this->template->var = "Lorem Ipsum.";
}
}
?>
18 changes: 0 additions & 18 deletions tests/Nexendrie/BookComponent/BookControlTest.phpt
Expand Up @@ -7,24 +7,6 @@ use Tester\Assert,

require __DIR__ . "/../../bootstrap.php";

class BookControl2 extends BookControl {
function __construct() {
parent::__construct("Test", __DIR__);
}

function getPages() {
$storage = new BookPagesStorage;
$storage[] = new BookPage("slug1", "title1");
$storage[] = new BookPage("slug2", "title2");
$storage[] = new BookPage("slug3", "title3");
return $storage;
}

function renderSlug1() {
$this->template->var = "Lorem Ipsum.";
}
}

/**
* BookControlTest
*
Expand Down

0 comments on commit 3487329

Please sign in to comment.