Skip to content

Commit

Permalink
test page scanner command
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Jan 11, 2021
1 parent d5b273f commit 3c70c36
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/page-scanner/tests/PageScannerCommandTest.php
@@ -0,0 +1,24 @@
<?php

namespace Pushword\PageScanner\Tests;

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester;

class PageScannerCommandTest extends KernelTestCase
{
public function testExecute()
{
$kernel = static::createKernel();
$application = new Application($kernel);

$command = $application->find('pushword:page:scan');
$commandTester = new CommandTester($command);
$commandTester->execute(['localhost.dev']);

// the output of the command in the console
$output = $commandTester->getDisplay();
$this->assertTrue(false !== strpos($output, 'done...'));
}
}
@@ -0,0 +1 @@
a:1:{i:1;a:1:{i:0;a:2:{s:7:"message";s:32:"<code>/admin/</code> introuvable";s:4:"page";a:5:{s:2:"id";i:1;s:4:"slug";s:8:"homepage";s:2:"h1";s:33:"Welcome : this is your first page";s:10:"metaRobots";N;s:4:"host";N;}}}}

0 comments on commit 3c70c36

Please sign in to comment.