Skip to content

Commit

Permalink
Merge pull request #5 from jeyroik/development
Browse files Browse the repository at this point in the history
fixed crawler by dyn plugins
  • Loading branch information
jeyroik committed Aug 31, 2020
2 parents a137727 + 8c63f1e commit 9948f81
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.2.4

- Crawler "by dynamic plugins" fixed.

# 0.2.3

- Verbosity added.
Expand Down
2 changes: 1 addition & 1 deletion src/components/crawlers/jsonrpc/ByDynamicPlugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function collectItemData(array $plugins): array
$repo = $this->$repoName();
$params = $this->getDefaultProperties($repo);
$info[] = [
'item_class' => $params['itemClass'] ?? '',
'item_class' => $params['class'] ?? '',
'entity_name' => $plugin['name'] ?? '',
'repository' => $repoName
];
Expand Down
20 changes: 20 additions & 0 deletions tests/crawlers/CrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,26 @@ public function testByDynamicPlugins()
);
}

public function testByDynamicPluginsMissed()
{
$output = $this->getOutput(true);
$crawler = new ByDynamicPlugins([
ByDynamicPlugins::FIELD__INPUT => $this->getTestInput(
ByDynamicPlugins::OPTION__PREFIX,
ByDynamicPlugins::OPTION__PATH,
'dyn.empty'
),
ByDynamicPlugins::FIELD__OUTPUT => $output
]);
$operations = $crawler();
$outputText = $output->fetch();
$this->assertStringContainsString(
'[X] Missed "plugins_install" in the "test/empty"',
$outputText,
'Incorrect output: ' . $outputText
);
}

/**
*
* @param string $prefixName
Expand Down
3 changes: 3 additions & 0 deletions tests/crawlers/misc/dyn.empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "test/empty"
}

0 comments on commit 9948f81

Please sign in to comment.