Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
[TASK] Cleanup Test-Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoBlack committed May 8, 2020
1 parent 74dd276 commit 006e3b9
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 97 deletions.
27 changes: 27 additions & 0 deletions Build/FunctionalTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="../.build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
>
<testsuites>
<testsuite name="Functional Test Suite">
<directory>../Tests/Functional/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">Classes/</directory>
</whitelist>
</filter>
</phpunit>
2 changes: 1 addition & 1 deletion Tests/Fixtures/CleanSVG/entity_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tests/Fixtures/CleanSVG/html.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tests/Fixtures/CleanSVG/simple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 72 additions & 72 deletions Tests/Fixtures/CleanSVG/xlink_laughs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tests/Fixtures/CleanSVG/xss.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace T3G\SvgSanitizer\Tests\Unit\Service;
namespace T3G\SvgSanitizer\Tests\Functional\Service;

/*
* This file is part of the TYPO3 extension svg_sanitizer.
Expand All @@ -18,12 +18,12 @@
use enshrined\svgSanitize\Sanitizer;
use Symfony\Component\Finder\Finder;
use T3G\SvgSanitizer\Service\SvgSanitizerService;
use TYPO3\TestingFramework\Core\BaseTestCase;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
* Class SvgSanitizerService
*/
class SvgSanitizerServiceTest extends BaseTestCase
class SvgSanitizerServiceTest extends FunctionalTestCase
{
/**
* Constructs a test case with the given name.
Expand All @@ -34,6 +34,8 @@ class SvgSanitizerServiceTest extends BaseTestCase
*/
public function __construct($name = null, array $data = [], $dataName = '')
{
$this->testExtensionsToLoad[] = 'web/typo3conf/ext/svg_sanitizer';

if (!class_exists(Sanitizer::class)) {
$extensionBasePath = dirname(__DIR__ . '/../../../../');
@include 'phar://' . $extensionBasePath . '/Libraries/enshrined-svg-sanitize.phar/vendor/autoload.php';
Expand Down
48 changes: 30 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
{
"name": "t3g/svg-sanitizer",
"description": "Sanitize SVG files on upload",
"type": "typo3-cms-extension",
"description": "Sanitize SVG files on upload",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "TYPO3 GmbH",
"role": "Developer",
"homepage": "https://typo3.com/"
"homepage": "https://typo3.com/",
"role": "Developer"
},
{
"name": "Frank Nägler",
"role": "Developer",
"homepage": "https://naegler.hamburg/"
"homepage": "https://naegler.hamburg/",
"role": "Developer"
}
],
"require": {
"enshrined/svg-sanitize": "^0.13.2",
"typo3/cms-core": "^8.7.13 || ^9.2 || ^10.1",
"typo3/cms-extbase": "^8.7.13 || ^9.2 || ^10.1",
"typo3/cms-install": "^8.7.13 || ^9.2 || ^10.1"
},
"replace": {
"t3g/svg_sanitizer": "self.version"
},
"require-dev": {
"bk2k/extension-helper": "^1.0",
"roave/security-advisories": "dev-master",
"typo3/testing-framework": "^2 || ^4.9 || ^5.0 || ^6.2"
},
"config": {
"sort-packages": true,
"bin-dir": ".build/bin",
"discard-changes": true,
"vendor-dir": ".build/vendor",
"bin-dir": ".build/bin"
"sort-packages": true,
"vendor-dir": ".build/vendor"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
},
"typo3/cms": {
"extension-key": "svg_sanitizer",
"web-dir": ".build"
Expand All @@ -43,15 +57,13 @@
"T3G\\SvgSanitizer\\Tests\\": "Tests/"
}
},
"require": {
"enshrined/svg-sanitize": "^0.13.2",
"typo3/cms-core": "^8.7.13 || ^9.2 || ^10.1",
"typo3/cms-extbase": "^8.7.13 || ^9.2 || ^10.1",
"typo3/cms-install": "^8.7.13 || ^9.2 || ^10.1"
},
"require-dev": {
"bk2k/extension-helper": "^1.0",
"phpunit/phpunit": "^6.2",
"roave/security-advisories": "dev-master"
"scripts": {
"post-autoload-dump": [
"mkdir -p .build/web/typo3conf/ext/",
"[ -L .build/web/typo3conf/ext/svg_sanitizer ] || ln -snvf ../../../../. .build/web/typo3conf/ext/svg_sanitizer"
],
"t3g:test:php:functional": [
"phpunit -c Build/FunctionalTest.xml --testsuite \"Functional Test Suite\""
]
}
}

0 comments on commit 006e3b9

Please sign in to comment.