Added lazy records collector to pass around.

This commit is contained in:
Andrey Savchenko committed 2018-12-27 16:58:50 +02:00
1 parent 960efd86ba
commit df0504f176
8 files changed
+77 -30

No files matched your search

+5 -4
View File
@@ -1,14 +1,15 @@
<?php
declare( strict_types=1 );
namespace Rarst\Laps\Tests\Manager;
use Brain\Monkey\Functions;
use Rarst\Laps\Manager\Toolbar_Manager;
use Rarst\Laps\Plugin;
use Rarst\Laps\Record\Collector\Lazy_Proxy_Collector;
use Rarst\Laps\Tests\LapsTestCase;
/**
* @coversDefaultClass Rarst\Laps\Manager\Toolbar_Manager
* @coversDefaultClass \Rarst\Laps\Manager\Toolbar_Manager
*/
class ToolbarTest extends LapsTestCase {
@@ -19,8 +20,8 @@ class ToolbarTest extends LapsTestCase {
*/
public function test__construct() {
$laps = new Plugin( [ 'records' => [] ] );
$manager = new Toolbar_Manager( $laps );
$collector = new Lazy_Proxy_Collector( [] );
$manager = new Toolbar_Manager( $collector, new \Mustache_Engine() );
$this->assertTrue( has_action( 'admin_bar_menu', [ $manager, 'admin_bar_menu' ] ) );
+4
View File
@@ -1,7 +1,9 @@
<?php
declare( strict_types=1 );
namespace Rarst\Laps\Tests\Provider;
use function Brain\Monkey\Functions\expect;
use Pimple\Exception\FrozenServiceException;
use Rarst\Laps\Plugin;
use Rarst\Laps\Provider\Manager_Provider;
@@ -14,6 +16,8 @@ class ManagerTest extends LapsTestCase {
*/
public function testProvider() {
expect( 'wp_normalize_path' )->zeroOrMoreTimes()->andReturnFirstArg();
$container = new Plugin();
$provider = new Manager_Provider();