<?php

/**
 * @file
 * Contains Drupal\AppConsole\Test\Generator\PluginBlockGeneratorTest.
 */

namespace Drupal\AppConsole\Test\Generator;

use Drupal\AppConsole\Generator\PluginBlockGenerator;
use Drupal\AppConsole\Test\DataProvider\PluginBlockDataProviderTrait;

class PluginBlockGeneratorTest extends GeneratorTest
{
    use PluginBlockDataProviderTrait;

    /**
     * PluginBlock generator test
     *
     * @param $module
     * @param $class_name
     * @param $label
     * @param $plugin_id
     * @param $services
     * @param $inputs
     *
     * @dataProvider commandData
     */
    public function testGeneratePluginBlock(
        $module,
        $class_name,
        $label,
        $plugin_id,
        $services,
        $inputs
    ) {
        $generator = new PluginBlockGenerator();
        $generator->setSkeletonDirs(__DIR__ . '/../../templates');
        $generator->setHelpers($this->getHelperSet());

        $generator->generate(
            $module,
            $class_name,
            $label,
            $plugin_id,
            $services,
            $inputs
        );

        $this->assertTrue(
            file_exists($generator->getSite()->getPluginPath($module, 'Block').'/'.$class_name.'.php'),
            sprintf('%s does not exist', $class_name.'.php')
        );        
    }
}
<?php

/**
 * @file
 * Contains Drupal\AppConsole\Test\Generator\PluginBlockGeneratorTest.
 */

namespace Drupal\AppConsole\Test\Generator;

use Drupal\AppConsole\Generator\PluginBlockGenerator;
use Drupal\AppConsole\Test\DataProvider\PluginBlockDataProviderTrait;

class PluginBlockGeneratorTest extends GeneratorTest
{
    use PluginBlockDataProviderTrait;

    /**
     * PluginBlock generator test
     *
     * @param $module
     * @param $class_name
     * @param $label
     * @param $plugin_id
     * @param $services
     * @param $inputs
     *
     * @dataProvider commandData
     */
    public function testGeneratePluginBlock(
        $module,
        $class_name,
        $label,
        $plugin_id,
        $services,
        $inputs
    ) {
        $generator = new PluginBlockGenerator();
        $generator->setSkeletonDirs(__DIR__ . '/../../templates');
        $generator->setHelpers($this->getHelperSet());

        $generator->generate(
            $module,
            $class_name,
            $label,
            $plugin_id,
            $services,
            $inputs
        );

        $this->assertTrue(
            file_exists($generator->getSite()->getPluginPath($module, 'Block').'/'.$class_name.'.php'),
            sprintf('%s does not exist', $class_name.'.php')
        );
    }
}

Apply phpqa using PSR2 standards
Apply phpqa using PSR2 standards
