Skip to content

Commit 373dc1d

Browse files
committed
Merge pull request #104 from vaniocz/1.2
Updated 1.2 to support Symfony 2.6 & 2.7
2 parents 204a83e + 163cf7f commit 373dc1d

File tree

12 files changed

+75
-56
lines changed

12 files changed

+75
-56
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ php: [5.3,5.4,5.5,5.6]
55
env:
66
- SF_VERSION='~2.3.0,>=2.3.19'
77
- SF_VERSION='~2.4.0,>=2.4.9'
8-
- SF_VERSION='~2.5.0,>=2.5.3,<=2.5.4'
8+
- SF_VERSION='~2.5.0,>=2.5.3'
9+
- SF_VERSION='~2.6.0,>=2.6.2'
910

1011
before_script:
1112
- export WEB_FIXTURES_HOST=http://localhost/index.php

Resources/public/js/constraints/False.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,4 @@
44
* @constructor
55
66
*/
7-
function SymfonyComponentValidatorConstraintsFalse() {
8-
this.message = '';
9-
10-
this.validate = function (value) {
11-
var errors = [];
12-
if ('' !== value && false !== value) {
13-
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
14-
}
15-
16-
return errors;
17-
}
18-
}
7+
var SymfonyComponentValidatorConstraintsFalse = SymfonyComponentValidatorConstraintsIsFalse;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//noinspection JSUnusedGlobalSymbols
2+
/**
3+
* Checks if value is (bool) false
4+
* @constructor
5+
6+
*/
7+
function SymfonyComponentValidatorConstraintsIsFalse() {
8+
this.message = '';
9+
10+
this.validate = function (value) {
11+
var errors = [];
12+
if ('' !== value && false !== value) {
13+
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
14+
}
15+
16+
return errors;
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//noinspection JSUnusedGlobalSymbols
2+
/**
3+
* Checks if value is null
4+
* @constructor
5+
6+
*/
7+
function SymfonyComponentValidatorConstraintsIsNull() {
8+
this.message = '';
9+
10+
this.validate = function(value) {
11+
var errors = [];
12+
if (null !== value) {
13+
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
14+
}
15+
16+
return errors;
17+
}
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//noinspection JSUnusedGlobalSymbols
2+
/**
3+
* Checks if value is (bool) true
4+
* @constructor
5+
6+
*/
7+
function SymfonyComponentValidatorConstraintsIsTrue() {
8+
this.message = '';
9+
10+
this.validate = function(value) {
11+
if ('' === value) {
12+
return [];
13+
}
14+
15+
var errors = [];
16+
if (true !== value) {
17+
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
18+
}
19+
20+
return errors;
21+
}
22+
}
23+

Resources/public/js/constraints/Null.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,4 @@
44
* @constructor
55
66
*/
7-
function SymfonyComponentValidatorConstraintsNull() {
8-
this.message = '';
9-
10-
this.validate = function(value) {
11-
var errors = [];
12-
if (null !== value) {
13-
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
14-
}
15-
16-
return errors;
17-
}
18-
}
7+
var SymfonyComponentValidatorConstraintsNull = SymfonyComponentValidatorConstraintsIsNull;

Resources/public/js/constraints/True.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,4 @@
44
* @constructor
55
66
*/
7-
function SymfonyComponentValidatorConstraintsTrue() {
8-
this.message = '';
9-
10-
this.validate = function(value) {
11-
if ('' === value) {
12-
return [];
13-
}
14-
15-
var errors = [];
16-
if (true !== value) {
17-
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
18-
}
19-
20-
return errors;
21-
}
22-
}
23-
7+
var SymfonyComponentValidatorConstraintsTrue = SymfonyComponentValidatorConstraintsIsTrue;

Tests/BaseMinkTestCase.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,9 @@ protected function makeScreenshot()
139139
}
140140

141141
try {
142-
$name = date('Y-m-d_H:i:s') . '.png';
143-
file_put_contents(
144-
'/tmp/' . $name,
145-
$this->session->getScreenshot()
146-
);
147-
$imageUrl = $this->getUploader()->upload('/tmp/' . $name);
142+
$path = sprintf('%s/%s.png', sys_get_temp_dir(), date('Y-m-d_H-i-s'));
143+
file_put_contents($path, $this->session->getScreenshot());
144+
$imageUrl = $this->getUploader()->upload($path);
148145
} catch (\Exception $e) {
149146
$imageUrl = $e->getMessage();
150147
}

Tests/TestBundles/DefaultTestBundle/Entity/BasicConstraintsEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ public function isValidSingleChoice()
711711
*/
712712
public function isValidMultipleChoice()
713713
{
714-
return $this->_t_get(array('June', 'July'), array('June', 'May', 'September'));
714+
return $this->_t_get(array('June', 'July'), array('June', 'May'));
715715
}
716716

717717
/**

Tests/TestBundles/DefaultTestBundle/Resources/views/FunctionalTests/index.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'isTypeScalar': function() { return _t.get(1, [1,2,3]); },
7575
'isTypeString': function() { return _t.get('1', 1); },
7676
'isValidSingleChoice': function() { return _t.get('male', 'wrong_choice'); },
77-
'isValidMultipleChoice': function() { return _t.get(['June', 'July'], ['June', 'May', 'September']); },
77+
'isValidMultipleChoice': function() { return _t.get(['June', 'July'], ['June', 'May']); },
7878
'isMinMultipleChoice': function() { return _t.get(['June', 'July'], ['June']); },
7979
'isMaxMultipleChoice': function() { return _t.get(['June'], ['June', 'July']); },
8080

0 commit comments

Comments
 (0)