Reorganized collector classes.
This commit is contained in:
1 parent
fb144ebe01
commit
961019ef74
16 files changed
+46
-34
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Rarst\Laps\Tests\Record;
|
||||
|
||||
use Rarst\Laps\Record\Core_Load_Collector;
|
||||
use Rarst\Laps\Record\Collector\Core_Load_Collector;
|
||||
use Rarst\Laps\Record\Record_Interface;
|
||||
use Rarst\Laps\Tests\LapsTestCase;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare( strict_types=1 );
|
||||
namespace Rarst\Laps\Tests\Record;
|
||||
|
||||
use Rarst\Laps\Event\Core_Events;
|
||||
use Rarst\Laps\Record\Hook_Record_Collector;
|
||||
use Rarst\Laps\Record\Collector\Hook_Collector;
|
||||
use Rarst\Laps\Tests\LapsTestCase;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
|
||||
@@ -13,7 +13,7 @@ class HookTest extends LapsTestCase {
|
||||
public function testCollector() {
|
||||
|
||||
$stopwatch = new Stopwatch();
|
||||
$collector = new Hook_Record_Collector( $stopwatch, [ 'core' => new Core_Events() ] );
|
||||
$collector = new Hook_Collector( $stopwatch, [ 'core' => new Core_Events() ] );
|
||||
|
||||
$this->assertTrue( $stopwatch->isStarted( 'Plugins Load' ) );
|
||||
$this->assertTrue( has_action( 'after_setup_theme', [ $collector, 'after_setup_theme' ] ) );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Rarst\Laps\Tests\Record;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use Rarst\Laps\Record\Http_Record_Collector;
|
||||
use Rarst\Laps\Record\Collector\Http_Collector;
|
||||
use Rarst\Laps\Tests\LapsTestCase;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
|
||||
@@ -16,7 +16,7 @@ class HttpTest extends LapsTestCase {
|
||||
|
||||
$stopwatch = new Stopwatch();
|
||||
$url = 'https://example.com/';
|
||||
$collector = new Http_Record_Collector( $stopwatch );
|
||||
$collector = new Http_Collector( $stopwatch );
|
||||
|
||||
$this->assertTrue( has_action( 'pre_http_request', [ $collector, 'pre_http_request' ] ) );
|
||||
$this->assertTrue( has_action( 'http_api_debug', [ $collector, 'http_api_debug' ] ) );
|
||||
|
||||
@@ -4,13 +4,13 @@ namespace Rarst\Laps\Tests\Record;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use Rarst\Laps\Record\Record;
|
||||
use Rarst\Laps\Record\Sql_Record_Collector;
|
||||
use Rarst\Laps\Record\Collector\Sql_Collector;
|
||||
use Rarst\Laps\Tests\LapsTestCase;
|
||||
|
||||
class SqlTest extends LapsTestCase {
|
||||
|
||||
/**
|
||||
* @covers \Rarst\Laps\Record\Sql_Record_Collector
|
||||
* @covers \Rarst\Laps\Record\Collector\Sql_Collector
|
||||
*/
|
||||
public function testCollector() {
|
||||
|
||||
@@ -22,7 +22,7 @@ class SqlTest extends LapsTestCase {
|
||||
}
|
||||
Functions\expect( 'wp_normalize_path' )->zeroOrMoreTimes()->andReturnFirstArg();
|
||||
|
||||
$collector = new Sql_Record_Collector();
|
||||
$collector = new Sql_Collector();
|
||||
|
||||
$this->assertTrue( has_filter( 'query', [ $collector, 'query' ] ) );
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Rarst\Laps\Tests\Record;
|
||||
|
||||
use Rarst\Laps\Record\Stopwatch_Record;
|
||||
use Rarst\Laps\Record\Stopwatch_Record_Collector;
|
||||
use Rarst\Laps\Record\Collector\Stopwatch_Collector;
|
||||
use Rarst\Laps\Tests\LapsTestCase;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
@@ -11,11 +11,11 @@ use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
class StopwatchTest extends LapsTestCase {
|
||||
|
||||
/**
|
||||
* @covers \Rarst\Laps\Record\Stopwatch_Record_Collector
|
||||
* @covers \Rarst\Laps\Record\Collector\Stopwatch_Collector
|
||||
*/
|
||||
public function testCollector() {
|
||||
|
||||
$collector = new Stopwatch_Record_Collector( new Stopwatch() );
|
||||
$collector = new Stopwatch_Collector( new Stopwatch() );
|
||||
|
||||
$collector->start( 'Event', 'info' );
|
||||
$collector->start( 'Not stopped', 'info' );
|
||||
|
||||
Reference in new issue
Block a user