Completed
Pull Request — master (#7)
by
unknown
02:26
created
tests/SettingsFieldTest.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -14,61 +14,61 @@
 block discarded – undo
14 14
 
15 15
 class SettingsFieldTest extends SapphireTest
16 16
 {
17
-    /**
18
-     * @expectedException InvalidArgumentException
19
-     */
20
-    public function testConstructorThrowsExceptionWhenGivenString()
21
-    {
22
-        new SettingsField('exception time!');
23
-    }
17
+	/**
18
+	 * @expectedException InvalidArgumentException
19
+	 */
20
+	public function testConstructorThrowsExceptionWhenGivenString()
21
+	{
22
+		new SettingsField('exception time!');
23
+	}
24 24
 
25
-    /**
26
-     * @expectedException InvalidArgumentException
27
-     */
28
-    public function testConstructorThrowsExceptionWhenGivenChildren()
29
-    {
30
-        new SettingsField(['i', 'don\'t', 'like', 'kids']);
31
-    }
25
+	/**
26
+	 * @expectedException InvalidArgumentException
27
+	 */
28
+	public function testConstructorThrowsExceptionWhenGivenChildren()
29
+	{
30
+		new SettingsField(['i', 'don\'t', 'like', 'kids']);
31
+	}
32 32
 
33
-    public function testFieldAddsJavascriptRequirements()
34
-    {
35
-        // Start with a clean slate (no global state interference)
36
-        Requirements::backend()->clear();
33
+	public function testFieldAddsJavascriptRequirements()
34
+	{
35
+		// Start with a clean slate (no global state interference)
36
+		Requirements::backend()->clear();
37 37
 
38
-        new SettingsField();
39
-        $javascript = Requirements::backend()->getJavascript();
40
-        $this->assertNotEmpty($javascript);
41
-    }
38
+		new SettingsField();
39
+		$javascript = Requirements::backend()->getJavascript();
40
+		$this->assertNotEmpty($javascript);
41
+	}
42 42
 
43
-    public function testFieldListGeneration()
44
-    {
45
-        $importField = new SettingsField();
43
+	public function testFieldListGeneration()
44
+	{
45
+		$importField = new SettingsField();
46 46
 
47
-        $fields = $importField->getChildren();
48
-        $this->assertInstanceOf(FieldList::class, $fields);
47
+		$fields = $importField->getChildren();
48
+		$this->assertInstanceOf(FieldList::class, $fields);
49 49
 
50
-        // We don't need to check that all of the fields are there, but just check a couple
51
-        $this->assertInstanceOf(HeaderField::class, $fields->fieldByName('FileWarningHeader'));
52
-        $innerField = $fields->fieldByName('ImportedFromFile');
53
-        $this->assertInstanceOf(ImportField::class, $innerField);
50
+		// We don't need to check that all of the fields are there, but just check a couple
51
+		$this->assertInstanceOf(HeaderField::class, $fields->fieldByName('FileWarningHeader'));
52
+		$innerField = $fields->fieldByName('ImportedFromFile');
53
+		$this->assertInstanceOf(ImportField::class, $innerField);
54 54
 
55
-        // Check the getter works
56
-        $this->assertSame($innerField, $importField->getInnerField());
55
+		// Check the getter works
56
+		$this->assertSame($innerField, $importField->getInnerField());
57 57
 
58
-        // Check the fields have been given has the change tracker disabled
59
-        $settingsFields = [
60
-            'SplitHeader' => DropdownField::class,
61
-            'KeepSource' => CheckboxField::class,
62
-            'ChosenFolderID' => TreeDropdownField::class,
63
-            'IncludeTOC' => CheckboxField::class,
64
-            'PublishPages' => CheckboxField::class
65
-        ];
66
-        foreach ($settingsFields as $fieldName => $className) {
67
-            $field = $fields->fieldByName(
68
-                'DocumentConversionSettings-' . $fieldName
69
-            );
70
-            $this->assertInstanceOf($className, $field);
71
-            $this->assertContains('no-change-track', $field->extraClass());
72
-        }
73
-    }
58
+		// Check the fields have been given has the change tracker disabled
59
+		$settingsFields = [
60
+			'SplitHeader' => DropdownField::class,
61
+			'KeepSource' => CheckboxField::class,
62
+			'ChosenFolderID' => TreeDropdownField::class,
63
+			'IncludeTOC' => CheckboxField::class,
64
+			'PublishPages' => CheckboxField::class
65
+		];
66
+		foreach ($settingsFields as $fieldName => $className) {
67
+			$field = $fields->fieldByName(
68
+				'DocumentConversionSettings-' . $fieldName
69
+			);
70
+			$this->assertInstanceOf($className, $field);
71
+			$this->assertContains('no-change-track', $field->extraClass());
72
+		}
73
+	}
74 74
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         ];
66 66
         foreach ($settingsFields as $fieldName => $className) {
67 67
             $field = $fields->fieldByName(
68
-                'DocumentConversionSettings-' . $fieldName
68
+                'DocumentConversionSettings-'.$fieldName
69 69
             );
70 70
             $this->assertInstanceOf($className, $field);
71 71
             $this->assertContains('no-change-track', $field->extraClass());
Please login to merge, or discard this patch.
tests/Stubs/MockDocvertService.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 
8 8
 class MockDocvertService extends ServiceConnector implements TestOnly
9 9
 {
10
-    public function import()
11
-    {
12
-        return '<h1>Fake document</h1><p>For testing purposes.</p>';
13
-    }
10
+	public function import()
11
+	{
12
+		return '<h1>Fake document</h1><p>For testing purposes.</p>';
13
+	}
14 14
 }
Please login to merge, or discard this patch.
src/PageExtension.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
 class PageExtension extends DataExtension
10 10
 {
11 11
 
12
-    private static $has_one = [
13
-        'ImportedFromFile' => File::class
14
-    ];
12
+	private static $has_one = [
13
+		'ImportedFromFile' => File::class
14
+	];
15 15
 
16
-    public function updateCMSFields(FieldList $fields)
17
-    {
18
-        /*
16
+	public function updateCMSFields(FieldList $fields)
17
+	{
18
+		/*
19 19
         // Currently the ToggleCompositeField plays badly with TreeDropdownField formatting.
20 20
         // Could be switched back in the future, if this is fixed.
21 21
         $fields->addFieldToTab('Root.Main', 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
             ])->setHeadingLevel(4)
25 25
         );
26 26
          */
27
-        $fields->findOrMakeTab(
28
-            'Root.Import',
29
-            _t(__CLASS__ . '.ImportTab', 'Import')
30
-        );
31
-        $fields->addFieldToTab('Root.Import', SettingsField::create());
32
-    }
27
+		$fields->findOrMakeTab(
28
+			'Root.Import',
29
+			_t(__CLASS__ . '.ImportTab', 'Import')
30
+		);
31
+		$fields->addFieldToTab('Root.Import', SettingsField::create());
32
+	}
33 33
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
          */
27 27
         $fields->findOrMakeTab(
28 28
             'Root.Import',
29
-            _t(__CLASS__ . '.ImportTab', 'Import')
29
+            _t(__CLASS__.'.ImportTab', 'Import')
30 30
         );
31 31
         $fields->addFieldToTab('Root.Import', SettingsField::create());
32 32
     }
Please login to merge, or discard this patch.