/**
  * (non-PHPdoc)
  * @see PHPUnit_Framework_TestCase::tearDown()
  */
 protected function tearDown()
 {
     foreach ($this->testFilesToDelete as $absoluteFileName) {
         rmdir($absoluteFileName);
     }
     parent::tearDown();
 }
Example #2
0
 public function setUp()
 {
     parent::setUp();
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     if (!class_exists('PhpParser\\Parser')) {
         throw new UnknownClassException('PhpParser not found!!');
     }
     $this->fixturesPath = __DIR__ . '/Fixtures/';
     $testTargetDir = 'testDir';
     vfsStream::setup($testTargetDir);
     $dummyExtensionDir = vfsStream::url($testTargetDir) . '/';
     $yamlParser = new \EBT\ExtensionBuilder\Utility\SpycYAMLParser();
     $settings = $yamlParser->YAMLLoadString(file_get_contents($this->fixturesPath . 'Settings/settings1.yaml'));
     $this->extension = $this->getMock('EBT\\ExtensionBuilder\\Domain\\Model\\Extension', array('getExtensionDir'));
     $this->extension->setVendorName('EBT');
     $this->extension->setExtensionKey('dummy');
     $this->extension->expects($this->any())->method('getExtensionDir')->will($this->returnValue($dummyExtensionDir));
     if (is_dir($dummyExtensionDir)) {
         GeneralUtility::mkdir($dummyExtensionDir, TRUE);
     }
     $this->extension->setSettings($settings);
     // get instances to inject in Mocks
     $configurationManager = $this->objectManager->get('EBT\\ExtensionBuilder\\Configuration\\ConfigurationManager');
     $this->parserService = new \EBT\ExtensionBuilder\Service\Parser(new \PhpParser\Lexer());
     $this->printerService = $this->objectManager->get('EBT\\ExtensionBuilder\\Service\\Printer');
     $localizationService = $this->objectManager->get('EBT\\ExtensionBuilder\\Service\\LocalizationService');
     $this->classBuilder = $this->objectManager->get('EBT\\ExtensionBuilder\\Service\\ClassBuilder');
     $this->classBuilder->initialize($this->extension, TRUE);
     $this->roundTripService = $this->getMock($this->buildAccessibleProxy('EBT\\ExtensionBuilder\\Service\\RoundTrip'), array('dummy'));
     $this->roundTripService->injectConfigurationManager($configurationManager);
     $this->roundTripService->injectParserService($this->parserService);
     $this->roundTripService->initialize($this->extension);
     $this->fileGenerator = $this->getMock($this->buildAccessibleProxy('EBT\\ExtensionBuilder\\Service\\FileGenerator'), array('dummy'));
     $this->fileGenerator->injectObjectManager($this->objectManager);
     $this->fileGenerator->injectPrinterService($this->printerService);
     $this->fileGenerator->injectLocalizationService($localizationService);
     $this->fileGenerator->injectClassBuilder($this->classBuilder);
     $this->fileGenerator->injectRoundtripService($this->roundTripService);
     $this->codeTemplateRootPath = PATH_typo3conf . 'ext/extension_builder/Resources/Private/CodeTemplates/Extbase/';
     $this->modelClassTemplatePath = $this->codeTemplateRootPath . 'Classes/Domain/Model/Model.phpt';
     $this->fileGenerator->setSettings(array('codeTemplateRootPath' => $this->codeTemplateRootPath, 'extConf' => array('enableRoundtrip' => '1')));
     $this->fileGenerator->_set('codeTemplateRootPath', __DIR__ . '/../Resources/Private/CodeTemplates/Extbase/');
     $this->fileGenerator->_set('enableRoundtrip', true);
     $this->fileGenerator->_set('extension', $this->extension);
 }
Example #3
0
 /**
  * Constructs a test case with the given name.
  *
  * @param string $name the name of a testcase
  * @param array $data ?
  * @param string $dataName ?
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->testDatabase = strtolower(TYPO3_db . '_test');
 }
Example #4
0
 /**
  * Set up creates a test instance and database.
  *
  * This method should be called with parent::setUp() in your test cases!
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // TODO: Change the autogenerated stub
 }
Example #5
0
 /**
  * setup
  */
 protected function setUp()
 {
     $this->objectManagerMock = $this->getMockBuilder('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->getMock();
     parent::setUp();
     // TODO: Change the autogenerated stub
 }