Skip to content

Commit

Permalink
Merge pull request #104 from vaniocz/1.2
Browse files Browse the repository at this point in the history
Updated 1.2 to support Symfony 2.6 & 2.7
  • Loading branch information
66Ton99 committed Mar 29, 2016
2 parents 204a83e + 163cf7f commit 373dc1d
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 56 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ php: [5.3,5.4,5.5,5.6]
env:
- SF_VERSION='~2.3.0,>=2.3.19'
- SF_VERSION='~2.4.0,>=2.4.9'
- SF_VERSION='~2.5.0,>=2.5.3,<=2.5.4'
- SF_VERSION='~2.5.0,>=2.5.3'
- SF_VERSION='~2.6.0,>=2.6.2'

before_script:
- export WEB_FIXTURES_HOST=http://localhost/index.php
Expand Down
13 changes: 1 addition & 12 deletions Resources/public/js/constraints/False.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,4 @@
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsFalse() {
this.message = '';

this.validate = function (value) {
var errors = [];
if ('' !== value && false !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}
var SymfonyComponentValidatorConstraintsFalse = SymfonyComponentValidatorConstraintsIsFalse;
18 changes: 18 additions & 0 deletions Resources/public/js/constraints/IsFalse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//noinspection JSUnusedGlobalSymbols
/**
* Checks if value is (bool) false
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsIsFalse() {
this.message = '';

this.validate = function (value) {
var errors = [];
if ('' !== value && false !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}
18 changes: 18 additions & 0 deletions Resources/public/js/constraints/IsNull.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//noinspection JSUnusedGlobalSymbols
/**
* Checks if value is null
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsIsNull() {
this.message = '';

this.validate = function(value) {
var errors = [];
if (null !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}
23 changes: 23 additions & 0 deletions Resources/public/js/constraints/IsTrue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//noinspection JSUnusedGlobalSymbols
/**
* Checks if value is (bool) true
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsIsTrue() {
this.message = '';

this.validate = function(value) {
if ('' === value) {
return [];
}

var errors = [];
if (true !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}

13 changes: 1 addition & 12 deletions Resources/public/js/constraints/Null.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,4 @@
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsNull() {
this.message = '';

this.validate = function(value) {
var errors = [];
if (null !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}
var SymfonyComponentValidatorConstraintsNull = SymfonyComponentValidatorConstraintsIsNull;
18 changes: 1 addition & 17 deletions Resources/public/js/constraints/True.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@
* @constructor
* @author [email protected]
*/
function SymfonyComponentValidatorConstraintsTrue() {
this.message = '';

this.validate = function(value) {
if ('' === value) {
return [];
}

var errors = [];
if (true !== value) {
errors.push(this.message.replace('{{ value }}', FpJsBaseConstraint.formatValue(value)));
}

return errors;
}
}

var SymfonyComponentValidatorConstraintsTrue = SymfonyComponentValidatorConstraintsIsTrue;
9 changes: 3 additions & 6 deletions Tests/BaseMinkTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,9 @@ protected function makeScreenshot()
}

try {
$name = date('Y-m-d_H:i:s') . '.png';
file_put_contents(
'/tmp/' . $name,
$this->session->getScreenshot()
);
$imageUrl = $this->getUploader()->upload('/tmp/' . $name);
$path = sprintf('%s/%s.png', sys_get_temp_dir(), date('Y-m-d_H-i-s'));
file_put_contents($path, $this->session->getScreenshot());
$imageUrl = $this->getUploader()->upload($path);
} catch (\Exception $e) {
$imageUrl = $e->getMessage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public function isValidSingleChoice()
*/
public function isValidMultipleChoice()
{
return $this->_t_get(array('June', 'July'), array('June', 'May', 'September'));
return $this->_t_get(array('June', 'July'), array('June', 'May'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
'isTypeScalar': function() { return _t.get(1, [1,2,3]); },
'isTypeString': function() { return _t.get('1', 1); },
'isValidSingleChoice': function() { return _t.get('male', 'wrong_choice'); },
'isValidMultipleChoice': function() { return _t.get(['June', 'July'], ['June', 'May', 'September']); },
'isValidMultipleChoice': function() { return _t.get(['June', 'July'], ['June', 'May']); },
'isMinMultipleChoice': function() { return _t.get(['June', 'July'], ['June']); },
'isMaxMultipleChoice': function() { return _t.get(['June'], ['June', 'July']); },
Expand Down
2 changes: 1 addition & 1 deletion Tests/app/Resources/BasicConstraintsEntity_sf_2_3.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public function isValidSingleChoice()
*/
public function isValidMultipleChoice()
{
return $this->_t_get(array('June', 'July'), array('June', 'May', 'September'));
return $this->_t_get(array('June', 'July'), array('June', 'May'));
}

/**
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

"require": {
"php": ">=5.3.2",
"symfony/form": ">=2.3,<=2.5.4",
"symfony/validator": "~2.3.0,>=2.3.19||~2.4.0,>=2.4.9||~2.5.0,>=2.5.3,<=2.5.4",
"symfony/symfony": "~2.3.0,>=2.3.19"
"symfony/form": ">=2.3,<2.7",
"symfony/validator": "~2.3.0,>=2.3.19||~2.4.0,>=2.4.9||>=2.5.3,<2.7",
"symfony/symfony": "~2.3.0,>=2.3.19||^2.4,<2.6||~2.6.2"
},

"require-dev": {
"doctrine/orm": ">=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"symfony/assetic-bundle": ">=2.3,<=2.5.4",
"symfony/assetic-bundle": "^2.3",
"phpunit/phpunit": "3.7.*",
"behat/mink-bundle": "dev-master",
"behat/mink-selenium2-driver": "1.1.0",
Expand All @@ -51,7 +51,7 @@

"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "1.2-dev"
}
}
}

0 comments on commit 373dc1d

Please sign in to comment.