Skip to content

Commit

Permalink
bugfix test update for CMS5
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish committed Nov 4, 2024
1 parent 43d5516 commit 63656fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
34 changes: 12 additions & 22 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
<?xml version="1.0"?>
<ruleset name="SS4">
<description>Coding standard for SilverStripe 4.x</description>

<!-- Don't sniff third party libraries -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/thirdparty/*</exclude-pattern>

<!-- Show progress and output sniff names on violation, and add colours -->
<arg value="sp"/>
<arg name="colors"/>

<!-- Use PSR-2 as a base standard -->
<rule ref="PSR2">
<!-- Allow classes to not declare a namespace -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>

<!-- Allow underscores in class names -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>

<!-- Allow non camel cased method names -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<file>src</file>
<file>tests</file>

<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
<exclude name="PSR1.Methods.CamelCapsMethodName" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
</rule>
</ruleset>
2 changes: 1 addition & 1 deletion src/ORM/FlexSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function updateCMSFields(FieldList $fields)
$config
);

$slideTitle = $this->owner->stat('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides');
$slideTitle = $this->owner->config()->get('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides');

$animations = [];
$animationOptions = $this->owner->dbObject('Animation')->getEnum();
Expand Down
2 changes: 1 addition & 1 deletion tests/FlexSliderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testTabNameConfig()
$this->assertNotNull($pageFields->dataFieldByName('Slides'));

Config::modify()
->update(TestPage::class, 'slide_tab_title', 'MyCustomSlideTitle');
->set(TestPage::class, 'slide_tab_title', 'MyCustomSlideTitle');
$page2 = TestPage::create();
$page2->write();
$page2Fields = $page2->getCMSFields();
Expand Down
2 changes: 1 addition & 1 deletion tests/SlideImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function testImageSizeLimit()
$this->assertEquals(Config::modify()->get(SlideImage::class, 'image_size_limit'), $default);

$new = 1024000;
Config::modify()->update(SlideImage::class, 'image_size_limit', $new);
Config::modify()->set(SlideImage::class, 'image_size_limit', $new);
$this->assertEquals(Config::modify()->get(SlideImage::class, 'image_size_limit'), $new);
}

Expand Down

0 comments on commit 63656fe

Please sign in to comment.