Skip to content

Commit

Permalink
#157 Renaming parser to extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
pfwd committed Nov 6, 2022
1 parent bce8944 commit c35120b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Markdown\Parser;
namespace App\Markdown\Extractor;

use DOMDocument;
use DOMNode;

class DocumentExtractor
class DOMExtractor
{
/** @var DOMNode[] **/
private array $question = [];
Expand Down
2 changes: 1 addition & 1 deletion api/src/Markdown/Model/Quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getName(): string
/**
* @return string
*/
public function getFilePath()
public function getFilePath(): string
{
return $this->filePath;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Tests\unit\src\Markdown\Parser;
namespace App\Tests\unit\src\Markdown\Extractor;

use App\Markdown\Parser\DocumentExtractor;
use App\Markdown\Extractor\DOMExtractor;
use PHPUnit\Framework\TestCase;

class CorrectAnswerExtractorTest extends TestCase
Expand All @@ -18,7 +18,7 @@ public function setUp(): void

public function testAnswerElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getCorrectAnswerNodes();

Expand All @@ -27,7 +27,7 @@ public function testAnswerElement()

public function testAnswerValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getCorrectAnswerNodes();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Tests\unit\src\Markdown\Parser;
namespace App\Tests\unit\src\Markdown\Extractor;

use App\Markdown\Parser\DocumentExtractor;
use App\Markdown\Extractor\DOMExtractor;
use PHPUnit\Framework\TestCase;

class PossibleAnswerExtractorTest extends TestCase
Expand All @@ -18,7 +18,7 @@ public function setUp(): void

public function testHeadingValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();

Expand All @@ -27,7 +27,7 @@ public function testHeadingValue()

public function testHeadingElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();

Expand All @@ -36,7 +36,7 @@ public function testHeadingElement()

public function testFirstPossibleAnswerValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();

Expand All @@ -45,7 +45,7 @@ public function testFirstPossibleAnswerValue()

public function testFirstPossibleAnswerElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();

Expand All @@ -55,7 +55,7 @@ public function testFirstPossibleAnswerElement()

public function testLastPossibleAnswerValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();
$lastIndex = count($nodes) - 1;
Expand All @@ -65,7 +65,7 @@ public function testLastPossibleAnswerValue()

public function testLastPossibleAnswerElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$nodes = $parser->getPossibleAnswerNodes();
$lastIndex = count($nodes) - 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Tests\unit\src\Markdown\Parser;
namespace App\Tests\unit\src\Markdown\Extractor;

use App\Markdown\Parser\DocumentExtractor;
use App\Markdown\Extractor\DOMExtractor;
use PHPUnit\Framework\TestCase;

class QuestionExtractorTest extends TestCase
Expand All @@ -19,7 +19,7 @@ public function setUp(): void

public function testQuestionHeadingValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getQuestionNodes();

Expand All @@ -28,7 +28,7 @@ public function testQuestionHeadingValue()

public function testQuestionHeadingElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getQuestionNodes();

Expand All @@ -37,7 +37,7 @@ public function testQuestionHeadingElement()

public function testLastQuestionElement()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getQuestionNodes();
$count = count($questionNodes) - 1;
Expand All @@ -47,7 +47,7 @@ public function testLastQuestionElement()

public function testLastQuestionValue()
{
$parser = new DocumentExtractor($this->document);
$parser = new DOMExtractor($this->document);
$parser->extract();
$questionNodes = $parser->getQuestionNodes();
$count = count($questionNodes) - 1;
Expand Down

0 comments on commit c35120b

Please sign in to comment.