mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Correct line length and endings
This commit is contained in:
parent
2566795b59
commit
dde90dc346
@ -286,7 +286,8 @@ class SS_ConfigStaticManifest_Parser {
|
||||
// NOP
|
||||
}
|
||||
else {
|
||||
user_error('Unexpected token ("' . token_name($type) . '") when building static manifest in class "' . $class . '": '.print_r($token, true), E_USER_ERROR);
|
||||
user_error('Unexpected token ("' . token_name($type) . '") when building static manifest in class "'
|
||||
. $class . '": '.print_r($token, true), E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,8 @@ class Mailer extends Object {
|
||||
$to = $this->validEmailAddr($to);
|
||||
|
||||
// Try it without the -f option if it fails
|
||||
if(!$bounceAddress || !($result = @mail($to, $subject, $fullBody, $headers, escapeshellarg("-f$bounceAddress")))) {
|
||||
if(!$bounceAddress ||
|
||||
!($result = @mail($to, $subject, $fullBody, $headers, escapeshellarg("-f$bounceAddress")))) {
|
||||
$result = mail($to, $subject, $fullBody, $headers);
|
||||
}
|
||||
|
||||
|
@ -446,7 +446,8 @@ class Image extends File {
|
||||
$filename = $format . "-" . $this->Name;
|
||||
$patterns = $this->getFilenamePatterns($this->Name);
|
||||
if (!preg_match($patterns['FullPattern'], $filename)) {
|
||||
throw new InvalidArgumentException('Filename ' . $filename . ' that should be used to cache a resized image is invalid');
|
||||
throw new InvalidArgumentException('Filename ' . $filename
|
||||
. ' that should be used to cache a resized image is invalid');
|
||||
}
|
||||
|
||||
return $folder . "_resampled/" . $filename;
|
||||
@ -564,7 +565,8 @@ class Image extends File {
|
||||
$generateFuncs = implode('|', $generateFuncs);
|
||||
$base64Match = "[a-zA-Z0-9\/\r\n+]*={0,2}";
|
||||
return array(
|
||||
'FullPattern' => "/^((?P<Generator>{$generateFuncs})(?P<Args>" . $base64Match . ")\-)+" . preg_quote($filename) . "$/i",
|
||||
'FullPattern' => "/^((?P<Generator>{$generateFuncs})(?P<Args>" . $base64Match . ")\-)+"
|
||||
. preg_quote($filename) . "$/i",
|
||||
'GeneratorPattern' => "/(?P<Generator>{$generateFuncs})(?P<Args>" . $base64Match . ")\-/i"
|
||||
);
|
||||
}
|
||||
|
@ -11,16 +11,16 @@ class RequestHandlingTest extends FunctionalTest {
|
||||
parent::setUp();
|
||||
|
||||
Config::inst()->update('Director', 'rules', array(
|
||||
// If we don't request any variables, then the whole URL will get shifted off. This is fine, but it means that the
|
||||
// controller will have to parse the Action from the URL itself.
|
||||
// If we don't request any variables, then the whole URL will get shifted off.
|
||||
// This is fine, but it means that the controller will have to parse the Action from the URL itself.
|
||||
'testGoodBase1' => "RequestHandlingTest_Controller",
|
||||
|
||||
// The double-slash indicates how much of the URL should be shifted off the stack. This is important for dealing
|
||||
// with nested request handlers appropriately.
|
||||
// The double-slash indicates how much of the URL should be shifted off the stack.
|
||||
// This is important for dealing with nested request handlers appropriately.
|
||||
'testGoodBase2//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller",
|
||||
|
||||
// By default, the entire URL will be shifted off. This creates a bit of backward-incompatability, but makes the
|
||||
// URL rules much more explicit.
|
||||
// By default, the entire URL will be shifted off. This creates a bit of
|
||||
// backward-incompatability, but makes the URL rules much more explicit.
|
||||
'testBadBase/$Action/$ID/$OtherID' => "RequestHandlingTest_Controller",
|
||||
|
||||
// Rules with an extension always default to the index() action
|
||||
|
@ -1,19 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class EnumFieldTest extends SapphireTest {
|
||||
public function testAnyFieldIsPresentInSearchField() {
|
||||
$values = array (
|
||||
'Key' => 'Value'
|
||||
);
|
||||
$enumField = new Enum('testField', $values);
|
||||
|
||||
$searchField = $enumField->scaffoldSearchField();
|
||||
|
||||
$anyText = "(" . _t('Enum.ANY', 'Any') . ")";
|
||||
$this->assertEquals(true, $searchField->getHasEmptyDefault());
|
||||
$this->assertEquals($anyText, $searchField->getEmptyString());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class EnumFieldTest extends SapphireTest {
|
||||
public function testAnyFieldIsPresentInSearchField() {
|
||||
$values = array (
|
||||
'Key' => 'Value'
|
||||
);
|
||||
$enumField = new Enum('testField', $values);
|
||||
|
||||
$searchField = $enumField->scaffoldSearchField();
|
||||
|
||||
$anyText = "(" . _t('Enum.ANY', 'Any') . ")";
|
||||
$this->assertEquals(true, $searchField->getHasEmptyDefault());
|
||||
$this->assertEquals($anyText, $searchField->getEmptyString());
|
||||
}
|
||||
}
|
||||
|
@ -598,7 +598,9 @@ class UploadFieldTest extends FunctionalTest {
|
||||
),
|
||||
'Removes dropzone');
|
||||
$this->assertTrue(
|
||||
(bool)$parser->getBySelector('#UploadFieldTestForm_Form_CanUploadFalseField_Holder .ss-uploadfield-fromfiles'),
|
||||
(bool)$parser->getBySelector(
|
||||
'#UploadFieldTestForm_Form_CanUploadFalseField_Holder .ss-uploadfield-fromfiles'
|
||||
),
|
||||
'Keeps "From files" button'
|
||||
);
|
||||
}
|
||||
|
@ -215,18 +215,22 @@ class ImageTest extends SapphireTest {
|
||||
// Encoding of the arguments is duplicated from cacheFilename
|
||||
$argumentString = base64_encode(json_encode(array(600,600,'0F0F0F')));
|
||||
$this->assertNotNull($imageThird);
|
||||
$this->assertContains($argumentString, $imageThird->getFullPath(), 'Image contains background color for padded resizement');
|
||||
$this->assertContains($argumentString, $imageThird->getFullPath(),
|
||||
'Image contains background color for padded resizement');
|
||||
|
||||
$imageThirdPath = $imageThird->getFullPath();
|
||||
$filesInFolder = $folder->find(dirname($imageThirdPath));
|
||||
$this->assertEquals(3, count($filesInFolder), 'Image folder contains only the expected number of images before regeneration');
|
||||
$this->assertEquals(3, count($filesInFolder),
|
||||
'Image folder contains only the expected number of images before regeneration');
|
||||
|
||||
$hash = md5_file($imageThirdPath);
|
||||
$this->assertEquals(3, $image->regenerateFormattedImages(), 'Cached images were regenerated in the right number');
|
||||
$this->assertEquals(3, $image->regenerateFormattedImages(),
|
||||
'Cached images were regenerated in the right number');
|
||||
$this->assertEquals($hash, md5_file($imageThirdPath), 'Regeneration of third image is correct');
|
||||
|
||||
/* Check that no other images exist, to ensure that the regeneration did not create other images */
|
||||
$this->assertEquals($filesInFolder, $folder->find(dirname($imageThirdPath)), 'Image folder contains only the expected image files after regeneration');
|
||||
$this->assertEquals($filesInFolder, $folder->find(dirname($imageThirdPath)),
|
||||
'Image folder contains only the expected image files after regeneration');
|
||||
}
|
||||
|
||||
public function testRegenerateImages() {
|
||||
@ -235,7 +239,8 @@ class ImageTest extends SapphireTest {
|
||||
$p = $image_generated->getFullPath();
|
||||
$this->assertTrue(file_exists($p), 'Resized image exists after creation call');
|
||||
$this->assertEquals(1, $image->regenerateFormattedImages(), 'Cached images were regenerated correct');
|
||||
$this->assertEquals($image_generated->getWidth(), 200, 'Resized image has correct width after regeneration call');
|
||||
$this->assertEquals($image_generated->getWidth(), 200,
|
||||
'Resized image has correct width after regeneration call');
|
||||
$this->assertTrue(file_exists($p), 'Resized image exists after regeneration call');
|
||||
}
|
||||
|
||||
@ -254,7 +259,8 @@ class ImageTest extends SapphireTest {
|
||||
rename($p, $newPath);
|
||||
$this->assertFalse(file_exists($p), 'Resized image does not exist after movement call under old name');
|
||||
$this->assertTrue(file_exists($newPath), 'Resized image exists after movement call under new name');
|
||||
$this->assertEquals(1, $image->regenerateFormattedImages(), 'Cached images were regenerated in the right number');
|
||||
$this->assertEquals(1, $image->regenerateFormattedImages(),
|
||||
'Cached images were regenerated in the right number');
|
||||
|
||||
$image_generated_2 = new Image_Cached($newRelative);
|
||||
$this->assertEquals(300, $image_generated_2->getWidth(), 'Cached image was regenerated with correct width');
|
||||
|
Loading…
Reference in New Issue
Block a user