Completed
Push — master ( b0b1c6...4fec92 )
by Fabien
54:17
created
Tests/Unit/Utility/PermissionUtilityTest.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@
 block discarded – undo
21 21
  */
22 22
 class PermissionUtilityTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var PermissionUtility
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var PermissionUtility
26
+	 */
27
+	private $fixture;
28 28
 
29
-    public function setUp()
30
-    {
31
-        $this->fixture = new PermissionUtility();
32
-    }
29
+	public function setUp()
30
+	{
31
+		$this->fixture = new PermissionUtility();
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        unset($this->fixture);
37
-    }
34
+	public function tearDown()
35
+	{
36
+		unset($this->fixture);
37
+	}
38 38
 
39
-    /**
40
-     * @test
41
-     */
42
-    public function checkWhetherPermissionUtilityIsCorrect()
43
-    {
44
-        $this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture);
45
-    }
39
+	/**
40
+	 * @test
41
+	 */
42
+	public function checkWhetherPermissionUtilityIsCorrect()
43
+	{
44
+		$this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Tests/Unit/Utility/PathTest.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -23,63 +23,63 @@
 block discarded – undo
23 23
  */
24 24
 class PathTest extends UnitTestCase
25 25
 {
26
-    public function setUp()
27
-    {
28
-    }
26
+	public function setUp()
27
+	{
28
+	}
29 29
 
30
-    public function tearDown()
31
-    {
32
-    }
30
+	public function tearDown()
31
+	{
32
+	}
33 33
 
34
-    /**
35
-     * @test
36
-     */
37
-    public function canResolvesAPath()
38
-    {
39
-        $resourceName = uniqid('resource');
40
-        $expected = 'media/Resources/Public/' . $resourceName;
41
-        $actual = Path::resolvePath($resourceName);
34
+	/**
35
+	 * @test
36
+	 */
37
+	public function canResolvesAPath()
38
+	{
39
+		$resourceName = uniqid('resource');
40
+		$expected = 'media/Resources/Public/' . $resourceName;
41
+		$actual = Path::resolvePath($resourceName);
42 42
 
43
-        $this->assertTrue(strpos($actual, $expected) > 0);
44
-        $this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected));
45
-    }
43
+		$this->assertTrue(strpos($actual, $expected) > 0);
44
+		$this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected));
45
+	}
46 46
 
47
-    /**
48
-     * @test
49
-     */
50
-    public function canReturnsAPublicPath()
51
-    {
52
-        $resourceName = uniqid('resource');
53
-        $expected = 'media/Resources/Public/' . $resourceName;
54
-        $actual = Path::getRelativePath($resourceName);
47
+	/**
48
+	 * @test
49
+	 */
50
+	public function canReturnsAPublicPath()
51
+	{
52
+		$resourceName = uniqid('resource');
53
+		$expected = 'media/Resources/Public/' . $resourceName;
54
+		$actual = Path::getRelativePath($resourceName);
55 55
 
56
-        $this->assertTrue(strpos($actual, $expected) > 0);
57
-        $this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected));
58
-    }
56
+		$this->assertTrue(strpos($actual, $expected) > 0);
57
+		$this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected));
58
+	}
59 59
 
60
-    /**
61
-     * @test
62
-     */
63
-    public function methodExistsReturnTrueForFileExistingInExtensionMedia()
64
-    {
65
-        $this->assertTrue(Path::exists('Icons/MissingMimeTypeIcon.png'));
66
-    }
60
+	/**
61
+	 * @test
62
+	 */
63
+	public function methodExistsReturnTrueForFileExistingInExtensionMedia()
64
+	{
65
+		$this->assertTrue(Path::exists('Icons/MissingMimeTypeIcon.png'));
66
+	}
67 67
 
68
-    /**
69
-     * @test
70
-     */
71
-    public function methodNotExistsReturnFalseForFileExistingInExtensionMedia()
72
-    {
73
-        $this->assertFalse(Path::notExists('Icons/MissingMimeTypeIcon.png'));
74
-    }
68
+	/**
69
+	 * @test
70
+	 */
71
+	public function methodNotExistsReturnFalseForFileExistingInExtensionMedia()
72
+	{
73
+		$this->assertFalse(Path::notExists('Icons/MissingMimeTypeIcon.png'));
74
+	}
75 75
 
76
-    /**
77
-     * @test
78
-     */
79
-    public function returnsCanonicalPathForPathContainingRelativeSegment()
80
-    {
81
-        $actual = '../bar/../../foo.png';
82
-        $expected = 'bar/foo.png';
83
-        $this->assertSame($expected, Path::canonicalPath($actual));
84
-    }
76
+	/**
77
+	 * @test
78
+	 */
79
+	public function returnsCanonicalPathForPathContainingRelativeSegment()
80
+	{
81
+		$actual = '../bar/../../foo.png';
82
+		$expected = 'bar/foo.png';
83
+		$this->assertSame($expected, Path::canonicalPath($actual));
84
+	}
85 85
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
     public function canResolvesAPath()
38 38
     {
39 39
         $resourceName = uniqid('resource');
40
-        $expected = 'media/Resources/Public/' . $resourceName;
40
+        $expected = 'media/Resources/Public/'.$resourceName;
41 41
         $actual = Path::resolvePath($resourceName);
42 42
 
43 43
         $this->assertTrue(strpos($actual, $expected) > 0);
44
-        $this->assertEquals(0, strpos(Environment::getPublicPath() . '/', $expected));
44
+        $this->assertEquals(0, strpos(Environment::getPublicPath().'/', $expected));
45 45
     }
46 46
 
47 47
     /**
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
     public function canReturnsAPublicPath()
51 51
     {
52 52
         $resourceName = uniqid('resource');
53
-        $expected = 'media/Resources/Public/' . $resourceName;
53
+        $expected = 'media/Resources/Public/'.$resourceName;
54 54
         $actual = Path::getRelativePath($resourceName);
55 55
 
56 56
         $this->assertTrue(strpos($actual, $expected) > 0);
57
-        $this->assertFalse(strpos(Environment::getPublicPath() . '/', $expected));
57
+        $this->assertFalse(strpos(Environment::getPublicPath().'/', $expected));
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.
Tests/Unit/FileUpload/UploadManagerTest.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -21,79 +21,79 @@
 block discarded – undo
21 21
  */
22 22
 class UploadManagerTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var UploadManager
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var UploadManager
26
+	 */
27
+	private $fixture;
28 28
 
29
-    /**
30
-     * @var string
31
-     */
32
-    private $fakeName = '';
29
+	/**
30
+	 * @var string
31
+	 */
32
+	private $fakeName = '';
33 33
 
34
-    /**
35
-     * @var string
36
-     */
37
-    private $fakePrefix = '';
34
+	/**
35
+	 * @var string
36
+	 */
37
+	private $fakePrefix = '';
38 38
 
39
-    public function setUp()
40
-    {
41
-        $this->fixture = new UploadManager();
42
-        $this->fakeName = uniqid('name');
43
-        $this->fakePrefix= uniqid('prefix');
44
-    }
39
+	public function setUp()
40
+	{
41
+		$this->fixture = new UploadManager();
42
+		$this->fakeName = uniqid('name');
43
+		$this->fakePrefix= uniqid('prefix');
44
+	}
45 45
 
46
-    public function tearDown()
47
-    {
48
-        unset($this->fixture);
49
-    }
46
+	public function tearDown()
47
+	{
48
+		unset($this->fixture);
49
+	}
50 50
 
51
-    /**
52
-     * @test
53
-     * @dataProvider propertyProvider
54
-     */
55
-    public function testProperty($propertyName, $value)
56
-    {
57
-        $setter = 'set' . ucfirst($propertyName);
58
-        $getter = 'get' . ucfirst($propertyName);
59
-        call_user_func_array(array($this->fixture, $setter), array($value));
60
-        $this->assertEquals($value, call_user_func(array($this->fixture, $getter)));
61
-    }
51
+	/**
52
+	 * @test
53
+	 * @dataProvider propertyProvider
54
+	 */
55
+	public function testProperty($propertyName, $value)
56
+	{
57
+		$setter = 'set' . ucfirst($propertyName);
58
+		$getter = 'get' . ucfirst($propertyName);
59
+		call_user_func_array(array($this->fixture, $setter), array($value));
60
+		$this->assertEquals($value, call_user_func(array($this->fixture, $getter)));
61
+	}
62 62
 
63
-    /**
64
-     * Provider
65
-     */
66
-    public function propertyProvider()
67
-    {
68
-        return array(
69
-            array('uploadFolder', uniqid()),
70
-            array('inputName', uniqid()),
71
-            array('sizeLimit', rand(10, 100)),
72
-        );
73
-    }
63
+	/**
64
+	 * Provider
65
+	 */
66
+	public function propertyProvider()
67
+	{
68
+		return array(
69
+			array('uploadFolder', uniqid()),
70
+			array('inputName', uniqid()),
71
+			array('sizeLimit', rand(10, 100)),
72
+		);
73
+	}
74 74
 
75
-    /**
76
-     * @test
77
-     * @dataProvider fileNameProvider
78
-     */
79
-    public function sanitizeFileNameTest($actual, $expected)
80
-    {
81
-        $this->assertSame($expected, $this->fixture->sanitizeFileName($actual));
82
-    }
75
+	/**
76
+	 * @test
77
+	 * @dataProvider fileNameProvider
78
+	 */
79
+	public function sanitizeFileNameTest($actual, $expected)
80
+	{
81
+		$this->assertSame($expected, $this->fixture->sanitizeFileName($actual));
82
+	}
83 83
 
84
-    /**
85
-     * Provider
86
-     */
87
-    public function fileNameProvider()
88
-    {
89
-        return array(
90
-            array('éléphant', 'elephant'),
91
-            array('foo bar', 'foo-bar'),
92
-            array('Foo Bar', 'Foo-Bar'),
93
-            array('foo_bar', 'foo_bar'),
94
-            array('foo&bar', 'foo-bar'),
95
-            array('foo!bar', 'foo-bar'),
96
-            array('foo~bar', 'foo-bar'),
97
-        );
98
-    }
84
+	/**
85
+	 * Provider
86
+	 */
87
+	public function fileNameProvider()
88
+	{
89
+		return array(
90
+			array('éléphant', 'elephant'),
91
+			array('foo bar', 'foo-bar'),
92
+			array('Foo Bar', 'Foo-Bar'),
93
+			array('foo_bar', 'foo_bar'),
94
+			array('foo&bar', 'foo-bar'),
95
+			array('foo!bar', 'foo-bar'),
96
+			array('foo~bar', 'foo-bar'),
97
+		);
98
+	}
99 99
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $this->fixture = new UploadManager();
42 42
         $this->fakeName = uniqid('name');
43
-        $this->fakePrefix= uniqid('prefix');
43
+        $this->fakePrefix = uniqid('prefix');
44 44
     }
45 45
 
46 46
     public function tearDown()
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function testProperty($propertyName, $value)
56 56
     {
57
-        $setter = 'set' . ucfirst($propertyName);
58
-        $getter = 'get' . ucfirst($propertyName);
57
+        $setter = 'set'.ucfirst($propertyName);
58
+        $getter = 'get'.ucfirst($propertyName);
59 59
         call_user_func_array(array($this->fixture, $setter), array($value));
60 60
         $this->assertEquals($value, call_user_func(array($this->fixture, $getter)));
61 61
     }
Please login to merge, or discard this patch.
Tests/Unit/FileUpload/ImageOptimizerTest.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -21,48 +21,48 @@
 block discarded – undo
21 21
  */
22 22
 class ImageOptimizerTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var ImageOptimizer
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var ImageOptimizer
26
+	 */
27
+	private $fixture;
28 28
 
29
-    public function setUp()
30
-    {
31
-        $this->fixture = new ImageOptimizer();
32
-    }
29
+	public function setUp()
30
+	{
31
+		$this->fixture = new ImageOptimizer();
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        unset($this->fixture);
37
-    }
34
+	public function tearDown()
35
+	{
36
+		unset($this->fixture);
37
+	}
38 38
 
39
-    /**
40
-     * @test
41
-     */
42
-    public function checkOptimizersPropertyContainsDefaultValues()
43
-    {
44
-        $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Resize', 'optimizers', $this->fixture);
45
-        $this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Rotate', 'optimizers', $this->fixture);
46
-    }
39
+	/**
40
+	 * @test
41
+	 */
42
+	public function checkOptimizersPropertyContainsDefaultValues()
43
+	{
44
+		$this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Resize', 'optimizers', $this->fixture);
45
+		$this->assertAttributeContains('Fab\Media\FileUpload\Optimizer\Rotate', 'optimizers', $this->fixture);
46
+	}
47 47
 
48
-    /**
49
-     * @test
50
-     */
51
-    public function addNewRandomOptimizer()
52
-    {
53
-        $optimizer = uniqid();
54
-        $this->fixture->add($optimizer);
55
-        $this->assertAttributeContains($optimizer, 'optimizers', $this->fixture);
56
-    }
48
+	/**
49
+	 * @test
50
+	 */
51
+	public function addNewRandomOptimizer()
52
+	{
53
+		$optimizer = uniqid();
54
+		$this->fixture->add($optimizer);
55
+		$this->assertAttributeContains($optimizer, 'optimizers', $this->fixture);
56
+	}
57 57
 
58
-    /**
59
-     * @test
60
-     */
61
-    public function addNewRandomAndRemoveOptimizer()
62
-    {
63
-        $optimizer = uniqid();
64
-        $this->fixture->add($optimizer);
65
-        $this->fixture->remove($optimizer);
66
-        $this->assertAttributeNotContains($optimizer, 'optimizers', $this->fixture);
67
-    }
58
+	/**
59
+	 * @test
60
+	 */
61
+	public function addNewRandomAndRemoveOptimizer()
62
+	{
63
+		$optimizer = uniqid();
64
+		$this->fixture->add($optimizer);
65
+		$this->fixture->remove($optimizer);
66
+		$this->assertAttributeNotContains($optimizer, 'optimizers', $this->fixture);
67
+	}
68 68
 }
Please login to merge, or discard this patch.
Tests/Unit/Grid/CategoryRendererTest.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@
 block discarded – undo
21 21
  */
22 22
 class CategoryRendererTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var CategoryRenderer
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var CategoryRenderer
26
+	 */
27
+	private $fixture;
28 28
 
29
-    public function setUp()
30
-    {
31
-        $this->fixture = new CategoryRenderer();
32
-    }
29
+	public function setUp()
30
+	{
31
+		$this->fixture = new CategoryRenderer();
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        unset($this->fixture);
37
-    }
34
+	public function tearDown()
35
+	{
36
+		unset($this->fixture);
37
+	}
38 38
 
39
-    /**
40
-     * @test
41
-     */
42
-    public function fixtureIsOfTypeGridRendererCategoryRenderer()
43
-    {
44
-        $this->assertInstanceOf('Fab\Media\Grid\CategoryRenderer', $this->fixture);
45
-    }
39
+	/**
40
+	 * @test
41
+	 */
42
+	public function fixtureIsOfTypeGridRendererCategoryRenderer()
43
+	{
44
+		$this->assertInstanceOf('Fab\Media\Grid\CategoryRenderer', $this->fixture);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Tests/Unit/Grid/UsageRendererTest.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@
 block discarded – undo
21 21
  */
22 22
 class UsageRendererTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var UsageRenderer
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var UsageRenderer
26
+	 */
27
+	private $fixture;
28 28
 
29
-    public function setUp()
30
-    {
31
-        $this->fixture = new UsageRenderer();
32
-    }
29
+	public function setUp()
30
+	{
31
+		$this->fixture = new UsageRenderer();
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        unset($this->fixture);
37
-    }
34
+	public function tearDown()
35
+	{
36
+		unset($this->fixture);
37
+	}
38 38
 
39
-    /**
40
-     * @test
41
-     */
42
-    public function fixtureIsOfTypeGridRendererUsageRenderer()
43
-    {
44
-        $this->assertInstanceOf('Fab\Media\Grid\UsageRenderer', $this->fixture);
45
-    }
39
+	/**
40
+	 * @test
41
+	 */
42
+	public function fixtureIsOfTypeGridRendererUsageRenderer()
43
+	{
44
+		$this->assertInstanceOf('Fab\Media\Grid\UsageRenderer', $this->fixture);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Tests/Unit/Grid/FrontendPermissionRendererTest.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@
 block discarded – undo
21 21
  */
22 22
 class FrontendPermissionRendererTest extends UnitTestCase
23 23
 {
24
-    /**
25
-     * @var FrontendPermissionRenderer
26
-     */
27
-    private $fixture;
24
+	/**
25
+	 * @var FrontendPermissionRenderer
26
+	 */
27
+	private $fixture;
28 28
 
29
-    public function setUp()
30
-    {
31
-        $this->fixture = new FrontendPermissionRenderer();
32
-    }
29
+	public function setUp()
30
+	{
31
+		$this->fixture = new FrontendPermissionRenderer();
32
+	}
33 33
 
34
-    public function tearDown()
35
-    {
36
-        unset($this->fixture);
37
-    }
34
+	public function tearDown()
35
+	{
36
+		unset($this->fixture);
37
+	}
38 38
 
39
-    /**
40
-     * @test
41
-     */
42
-    public function fixtureIsOfTypeGridRendererFrontendPermissionRenderer()
43
-    {
44
-        $this->assertInstanceOf('Fab\Media\Grid\FrontendPermissionRenderer', $this->fixture);
45
-    }
39
+	/**
40
+	 * @test
41
+	 */
42
+	public function fixtureIsOfTypeGridRendererFrontendPermissionRenderer()
43
+	{
44
+		$this->assertInstanceOf('Fab\Media\Grid\FrontendPermissionRenderer', $this->fixture);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Tests/Functional/Form/FileUploadTest.php 2 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -24,75 +24,75 @@
 block discarded – undo
24 24
  */
25 25
 class FileUploadTest extends AbstractFunctionalTestCase
26 26
 {
27
-    /**
28
-     * @var FileUpload
29
-     */
30
-    private $fixture;
31
-
32
-    /**
33
-     * @var string
34
-     */
35
-    private $fakeName = '';
36
-
37
-    /**
38
-     * @var string
39
-     */
40
-    private $fakePrefix = '';
41
-
42
-    public function setUp()
43
-    {
44
-        parent::setUp();
45
-
46
-        $this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
47
-        $this->fakeName = uniqid('name');
48
-        $this->fakePrefix= uniqid('prefix');
49
-    }
50
-
51
-    public function tearDown()
52
-    {
53
-        unset($this->fixture);
54
-    }
55
-
56
-    /**
57
-     * @test
58
-     */
59
-    public function getJavaScriptMethodReturnNotEmptyContent()
60
-    {
61
-        $method = new \ReflectionMethod(
62
-            'Fab\Media\Form\FileUpload',
63
-            'getJavaScript'
64
-        );
65
-
66
-        $method->setAccessible(true);
67
-        #$actual = $method->invoke($this->fixture);
68
-        $this->markTestIncomplete('Fix test by mocking storage');
69
-        #$this->assertNotEmpty($actual);
70
-    }
71
-
72
-    /**
73
-     * @test
74
-     */
75
-    public function renderFileUploadIsNotEmptyByDefault()
76
-    {
77
-        $this->markTestIncomplete('Fix test by mocking storage');
78
-        #$this->assertNotEmpty($this->fixture->render());
79
-    }
80
-
81
-    /**
82
-     * @test
83
-     */
84
-    public function getBasePrefixStripsTheSquareBraquets()
85
-    {
86
-        $method = new \ReflectionMethod(
87
-            'Fab\Media\Form\FileUpload',
88
-            'getBasePrefix'
89
-        );
90
-
91
-        $method->setAccessible(true);
92
-
93
-        $basePart = uniqid();
94
-        $fakePrefix = $basePart . '[foo]';
95
-        $actual = $method->invokeArgs($this->fixture, array($fakePrefix));
96
-        $this->assertSame($basePart, $actual);
97
-    }
27
+	/**
28
+	 * @var FileUpload
29
+	 */
30
+	private $fixture;
31
+
32
+	/**
33
+	 * @var string
34
+	 */
35
+	private $fakeName = '';
36
+
37
+	/**
38
+	 * @var string
39
+	 */
40
+	private $fakePrefix = '';
41
+
42
+	public function setUp()
43
+	{
44
+		parent::setUp();
45
+
46
+		$this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
47
+		$this->fakeName = uniqid('name');
48
+		$this->fakePrefix= uniqid('prefix');
49
+	}
50
+
51
+	public function tearDown()
52
+	{
53
+		unset($this->fixture);
54
+	}
55
+
56
+	/**
57
+	 * @test
58
+	 */
59
+	public function getJavaScriptMethodReturnNotEmptyContent()
60
+	{
61
+		$method = new \ReflectionMethod(
62
+			'Fab\Media\Form\FileUpload',
63
+			'getJavaScript'
64
+		);
65
+
66
+		$method->setAccessible(true);
67
+		#$actual = $method->invoke($this->fixture);
68
+		$this->markTestIncomplete('Fix test by mocking storage');
69
+		#$this->assertNotEmpty($actual);
70
+	}
71
+
72
+	/**
73
+	 * @test
74
+	 */
75
+	public function renderFileUploadIsNotEmptyByDefault()
76
+	{
77
+		$this->markTestIncomplete('Fix test by mocking storage');
78
+		#$this->assertNotEmpty($this->fixture->render());
79
+	}
80
+
81
+	/**
82
+	 * @test
83
+	 */
84
+	public function getBasePrefixStripsTheSquareBraquets()
85
+	{
86
+		$method = new \ReflectionMethod(
87
+			'Fab\Media\Form\FileUpload',
88
+			'getBasePrefix'
89
+		);
90
+
91
+		$method->setAccessible(true);
92
+
93
+		$basePart = uniqid();
94
+		$fakePrefix = $basePart . '[foo]';
95
+		$actual = $method->invokeArgs($this->fixture, array($fakePrefix));
96
+		$this->assertSame($basePart, $actual);
97
+	}
98 98
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 use Fab\Media\Tests\Functional\AbstractFunctionalTestCase;
19 19
 
20
-require_once dirname(dirname(__FILE__)) . '/AbstractFunctionalTestCase.php';
20
+require_once dirname(dirname(__FILE__)).'/AbstractFunctionalTestCase.php';
21 21
 
22 22
 /**
23 23
  * Test case for class \Fab\Media\Form\FileUpload.
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
47 47
         $this->fakeName = uniqid('name');
48
-        $this->fakePrefix= uniqid('prefix');
48
+        $this->fakePrefix = uniqid('prefix');
49 49
     }
50 50
 
51 51
     public function tearDown()
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $method->setAccessible(true);
92 92
 
93 93
         $basePart = uniqid();
94
-        $fakePrefix = $basePart . '[foo]';
94
+        $fakePrefix = $basePart.'[foo]';
95 95
         $actual = $method->invokeArgs($this->fixture, array($fakePrefix));
96 96
         $this->assertSame($basePart, $actual);
97 97
     }
Please login to merge, or discard this patch.
Tests/Functional/Utility/ImagePresetUtilityTest.php 2 patches
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -25,124 +25,124 @@
 block discarded – undo
25 25
  */
26 26
 class ImagePresetUtilityTest extends AbstractFunctionalTestCase
27 27
 {
28
-    /**
29
-     * @var ImagePresetUtility
30
-     */
31
-    private $fixture;
32
-
33
-    public function setUp()
34
-    {
35
-        parent::setUp();
36
-        $this->fixture = new ImagePresetUtility();
37
-    }
38
-
39
-    public function tearDown()
40
-    {
41
-        GeneralUtility::purgeInstances();
42
-        unset($this->fixture);
43
-    }
44
-
45
-    /**
46
-     * @test
47
-     * @expectedException \Fab\Media\Exception\EmptyValueException
48
-     */
49
-    public function randomPresetShouldReturnException()
50
-    {
51
-        $this->fixture->preset(uniqid());
52
-    }
53
-
54
-    /**
55
-     * @test
56
-     */
57
-    public function methodPresetReturnInstanceOfImagePresetUtility()
58
-    {
59
-        $actual = 'image_thumbnail';
60
-        $object = $this->fixture->preset($actual);
61
-        $this->assertTrue($object instanceof ImagePresetUtility);
62
-    }
63
-
64
-    /**
65
-     * @test
66
-     */
67
-    public function propertyIsEmptyByDefault()
68
-    {
69
-        $this->assertEmpty($this->fixture->getStore());
70
-    }
71
-
72
-    /**
73
-     * @test
74
-     */
75
-    public function setImageThumbnailAsPresetAndCheckTheStoreContainsIt()
76
-    {
77
-        $actual = 'image_thumbnail';
78
-        $this->fixture->preset($actual);
79
-        $this->assertArrayHasKey($actual, $this->fixture->getStore());
80
-    }
81
-
82
-
83
-    /**
84
-     * @test
85
-     * @dataProvider presetProvider
86
-     */
87
-    public function testProperty($preset, $setting, $width, $height)
88
-    {
89
-        ConfigurationUtility::getInstance()->set($preset, $setting);
90
-        $this->assertSame($width, $this->fixture->preset($preset)->getWidth());
91
-        $this->assertSame($height, $this->fixture->preset($preset)->getHeight());
92
-    }
93
-
94
-    /**
95
-     * Provider
96
-     */
97
-    public function presetProvider()
98
-    {
99
-        return array(
100
-            array('image_thumbnail', '110x100', 110, 100),
101
-            array('image_mini', '130x120', 130, 120),
102
-            array('image_small', '340x320', 340, 320),
103
-            array('image_medium', '780x760', 780, 760),
104
-            array('image_large', '1210x1200', 1210, 1200),
105
-        );
106
-    }
107
-
108
-    /**
109
-     * @test
110
-     * @expectedException \Fab\Media\Exception\InvalidKeyInArrayException
111
-     */
112
-    public function getWidthWithoutPresetRaisesAnException()
113
-    {
114
-        $this->fixture->getWidth();
115
-    }
116
-
117
-    /**
118
-     * @test
119
-     * @expectedException \Fab\Media\Exception\InvalidKeyInArrayException
120
-     */
121
-    public function getHeightWithoutPresetRaisesAnException()
122
-    {
123
-        $this->fixture->getHeight();
124
-    }
125
-
126
-    /**
127
-     * @test
128
-     */
129
-    public function setOriginalImageAsPresetWithValue0AndCheckWidthEquals0()
130
-    {
131
-        $actual = 'image_large';
132
-        ConfigurationUtility::getInstance()->set('image_large', 0);
133
-        $this->assertSame(0, $this->fixture->preset($actual)->getWidth());
134
-    }
135
-
136
-    /**
137
-     * @test
138
-     */
139
-    public function setOriginalImageAsPresetWithRandomValueAndCheckWidthAndHeightCorrespondsToThisRandomValue()
140
-    {
141
-        $preset = 'image_large';
142
-        $actualWidth = rand(10, 100);
143
-        $actualHeight = rand(10, 100);
144
-        ConfigurationUtility::getInstance()->set('image_large', $actualWidth . 'x' . $actualHeight);
145
-        $this->assertSame($actualWidth, $this->fixture->preset($preset)->getWidth());
146
-        $this->assertSame($actualHeight, $this->fixture->preset($preset)->getHeight());
147
-    }
28
+	/**
29
+	 * @var ImagePresetUtility
30
+	 */
31
+	private $fixture;
32
+
33
+	public function setUp()
34
+	{
35
+		parent::setUp();
36
+		$this->fixture = new ImagePresetUtility();
37
+	}
38
+
39
+	public function tearDown()
40
+	{
41
+		GeneralUtility::purgeInstances();
42
+		unset($this->fixture);
43
+	}
44
+
45
+	/**
46
+	 * @test
47
+	 * @expectedException \Fab\Media\Exception\EmptyValueException
48
+	 */
49
+	public function randomPresetShouldReturnException()
50
+	{
51
+		$this->fixture->preset(uniqid());
52
+	}
53
+
54
+	/**
55
+	 * @test
56
+	 */
57
+	public function methodPresetReturnInstanceOfImagePresetUtility()
58
+	{
59
+		$actual = 'image_thumbnail';
60
+		$object = $this->fixture->preset($actual);
61
+		$this->assertTrue($object instanceof ImagePresetUtility);
62
+	}
63
+
64
+	/**
65
+	 * @test
66
+	 */
67
+	public function propertyIsEmptyByDefault()
68
+	{
69
+		$this->assertEmpty($this->fixture->getStore());
70
+	}
71
+
72
+	/**
73
+	 * @test
74
+	 */
75
+	public function setImageThumbnailAsPresetAndCheckTheStoreContainsIt()
76
+	{
77
+		$actual = 'image_thumbnail';
78
+		$this->fixture->preset($actual);
79
+		$this->assertArrayHasKey($actual, $this->fixture->getStore());
80
+	}
81
+
82
+
83
+	/**
84
+	 * @test
85
+	 * @dataProvider presetProvider
86
+	 */
87
+	public function testProperty($preset, $setting, $width, $height)
88
+	{
89
+		ConfigurationUtility::getInstance()->set($preset, $setting);
90
+		$this->assertSame($width, $this->fixture->preset($preset)->getWidth());
91
+		$this->assertSame($height, $this->fixture->preset($preset)->getHeight());
92
+	}
93
+
94
+	/**
95
+	 * Provider
96
+	 */
97
+	public function presetProvider()
98
+	{
99
+		return array(
100
+			array('image_thumbnail', '110x100', 110, 100),
101
+			array('image_mini', '130x120', 130, 120),
102
+			array('image_small', '340x320', 340, 320),
103
+			array('image_medium', '780x760', 780, 760),
104
+			array('image_large', '1210x1200', 1210, 1200),
105
+		);
106
+	}
107
+
108
+	/**
109
+	 * @test
110
+	 * @expectedException \Fab\Media\Exception\InvalidKeyInArrayException
111
+	 */
112
+	public function getWidthWithoutPresetRaisesAnException()
113
+	{
114
+		$this->fixture->getWidth();
115
+	}
116
+
117
+	/**
118
+	 * @test
119
+	 * @expectedException \Fab\Media\Exception\InvalidKeyInArrayException
120
+	 */
121
+	public function getHeightWithoutPresetRaisesAnException()
122
+	{
123
+		$this->fixture->getHeight();
124
+	}
125
+
126
+	/**
127
+	 * @test
128
+	 */
129
+	public function setOriginalImageAsPresetWithValue0AndCheckWidthEquals0()
130
+	{
131
+		$actual = 'image_large';
132
+		ConfigurationUtility::getInstance()->set('image_large', 0);
133
+		$this->assertSame(0, $this->fixture->preset($actual)->getWidth());
134
+	}
135
+
136
+	/**
137
+	 * @test
138
+	 */
139
+	public function setOriginalImageAsPresetWithRandomValueAndCheckWidthAndHeightCorrespondsToThisRandomValue()
140
+	{
141
+		$preset = 'image_large';
142
+		$actualWidth = rand(10, 100);
143
+		$actualHeight = rand(10, 100);
144
+		ConfigurationUtility::getInstance()->set('image_large', $actualWidth . 'x' . $actualHeight);
145
+		$this->assertSame($actualWidth, $this->fixture->preset($preset)->getWidth());
146
+		$this->assertSame($actualHeight, $this->fixture->preset($preset)->getHeight());
147
+	}
148 148
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 18
 use Fab\Media\Tests\Functional\AbstractFunctionalTestCase;
19 19
 
20
-require_once dirname(dirname(__FILE__)) . '/AbstractFunctionalTestCase.php';
20
+require_once dirname(dirname(__FILE__)).'/AbstractFunctionalTestCase.php';
21 21
 
22 22
 
23 23
 /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $preset = 'image_large';
142 142
         $actualWidth = rand(10, 100);
143 143
         $actualHeight = rand(10, 100);
144
-        ConfigurationUtility::getInstance()->set('image_large', $actualWidth . 'x' . $actualHeight);
144
+        ConfigurationUtility::getInstance()->set('image_large', $actualWidth.'x'.$actualHeight);
145 145
         $this->assertSame($actualWidth, $this->fixture->preset($preset)->getWidth());
146 146
         $this->assertSame($actualHeight, $this->fixture->preset($preset)->getHeight());
147 147
     }
Please login to merge, or discard this patch.