Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Add missing EventEmitter resource
Browse files Browse the repository at this point in the history
  • Loading branch information
nesk committed Nov 30, 2020
1 parent d719d83 commit d3b4b25
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/Resources/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Nesk\Puphpeteer\Resources;

use Nesk\Rialto\Data\BasicResource;

class Browser extends BasicResource
class Browser extends EventEmitter
{
//
}
4 changes: 1 addition & 3 deletions src/Resources/BrowserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Nesk\Puphpeteer\Resources;

use Nesk\Rialto\Data\BasicResource;

class BrowserContext extends BasicResource
class BrowserContext extends EventEmitter
{
//
}
4 changes: 1 addition & 3 deletions src/Resources/CDPSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Nesk\Puphpeteer\Resources;

use Nesk\Rialto\Data\BasicResource;

class CDPSession extends BasicResource
class CDPSession extends EventEmitter
{
//
}
10 changes: 10 additions & 0 deletions src/Resources/EventEmitter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Nesk\Puphpeteer\Resources;

use Nesk\Rialto\Data\BasicResource;

class EventEmitter extends BasicResource
{
//
}
3 changes: 1 addition & 2 deletions src/Resources/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Nesk\Puphpeteer\Resources;

use Nesk\Rialto\Data\BasicResource;
use Nesk\Puphpeteer\Traits\AliasesSelectionMethods;
use Nesk\Puphpeteer\Traits\AliasesEvaluationMethods;

class Page extends BasicResource
class Page extends EventEmitter
{
use AliasesSelectionMethods, AliasesEvaluationMethods;
}
3 changes: 3 additions & 0 deletions tests/ResourceInstantiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public function __construct(array $browserOptions, string $url) {
'ElementHandle' => function ($puppeteer) {
return $this->Page($puppeteer)->querySelector('body');
},
'EventEmitter' => function ($puppeteer) {
return $puppeteer->launch($this->browserOptions);
},
'ExecutionContext' => function ($puppeteer) {
return $this->Frame($puppeteer)->executionContext();
},
Expand Down

0 comments on commit d3b4b25

Please sign in to comment.