Robert Korulczyk
ba0ab403b5
Added php-cs-fixer coding standards validation to Travis CI ( #14100 )
...
* php-cs-fixer: PSR2 rule.
* php-cs-fixer: PSR2 rule - fix views.
* Travis setup refactoring.
* Add php-cs-fixer to travis cs tests.
* Fix tests on hhvm-3.12
* improve travis config
* composer update
* revert composer update
* improve travis config
* Fix CS.
* Extract config to separate classes.
* Extract config to separate classes.
* Add file header.
* Force short array syntax.
* binary_operator_spaces fixer
* Fix broken tests
* cast_spaces fixer
* concat_space fixer
* dir_constant fixer
* ereg_to_preg fixer
* function_typehint_space fixer
* hash_to_slash_comment fixer
* is_null fixer
* linebreak_after_opening_tag fixer
* lowercase_cast fixer
* magic_constant_casing fixer
* modernize_types_casting fixer
* native_function_casing fixer
* new_with_braces fixer
* no_alias_functions fixer
* no_blank_lines_after_class_opening fixer
* no_blank_lines_after_phpdoc fixer
* no_empty_comment fixer
* no_empty_phpdoc fixer
* no_empty_statement fixer
* no_extra_consecutive_blank_lines fixer
* no_leading_import_slash fixer
* no_leading_namespace_whitespace fixer
* no_mixed_echo_print fixer
* no_multiline_whitespace_around_double_arrow fixer
* no_multiline_whitespace_before_semicolons fixer
* no_php4_constructor fixer
* no_short_bool_cast fixer
* no_singleline_whitespace_before_semicolons fixer
* no_spaces_around_offset fixer
* no_trailing_comma_in_list_call fixer
* no_trailing_comma_in_singleline_array fixer
* no_unneeded_control_parentheses fixer
* no_unused_imports fixer
* no_useless_return fixer
* no_whitespace_before_comma_in_array fixer
* no_whitespace_in_blank_line fixer
* not_operator_with_successor_space fixer
* object_operator_without_whitespace fixer
* ordered_imports fixer
* php_unit_construct fixer
* php_unit_dedicate_assert fixer
* php_unit_fqcn_annotation fixer
* phpdoc_indent fixer
* phpdoc_no_access fixer
* phpdoc_no_empty_return fixer
* phpdoc_no_package fixer
* phpdoc_no_useless_inheritdoc fixer
* Fix broken tests
* phpdoc_return_self_reference fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_to_comment fixer
* phpdoc_trim fixer
* phpdoc_var_without_name fixer
* psr4 fixer
* self_accessor fixer
* short_scalar_cast fixer
* single_blank_line_before_namespace fixer
* single_quote fixer
* standardize_not_equals fixer
* ternary_operator_spaces fixer
* trailing_comma_in_multiline_array fixer
* trim_array_spaces fixer
* protected_to_private fixer
* unary_operator_spaces fixer
* whitespace_after_comma_in_array fixer
* `parent::setRules()` -> `$this->setRules()`
* blank_line_after_opening_tag fixer
* Update finder config.
* Revert changes for YiiRequirementChecker.
* Fix array formatting.
* Add missing import.
* Fix CS for new code merged from master.
* Fix some indentation issues.
7 years ago
Robert Korulczyk
daa8b67c7b
Fixes #13350 , #14094 , #11288
...
- Bug #13350 : Fixed bug with incorrect caching of `yii\web\UrlRule::createUrl()` results in `yii\web\UrlManager`.
- Bug #14094 : Fixed bug when single `yii\web\UrlManager::createUrl()` call my result multiple calls of `yii\web\UrlRule::createUrl()` for the same rule.
- Enh #11288 : Added support for caching of `yii\web\UrlRule::createUrl()` results in `yii\web\UrlManager` for rules with defaults.
7 years ago
Carsten Brandt
3e79d56447
made AssetBundle tests less cryptic
...
cleanup step was added in setUp() so this will still work.
split test functions filehelper test
7 years ago
Carsten Brandt
5e8e6840b6
Added copyEmptyDirectories option to FileHelper
...
also set it to false in AssetManager to avoid creating a lot of empty
directories.
fixes #9669
7 years ago
quantum
583a2bcb9f
failing test for asset bundle publishing empty directories
7 years ago
Robert Korulczyk
31e321b9b2
Remove unused imports. ( #14096 )
8 years ago
sasha-ch
339c7663eb
Fixes #10346 : Fixed "DOMException: Invalid Character Error" in `yii\web\XmlResponseFormatter::buildXml()`
8 years ago
Klimov Paul
04a14efd3f
compatibility with PHPUnit 6.x fix
8 years ago
Klimov Paul
15561b7a2c
unit test fix
8 years ago
Klimov Paul
dee88787fc
compatibility with PHPUnit 6.x added
8 years ago
Sam Mousa
183ebc5985
Revert "Moved serialization of `Cookie` to `Cookie`. Added unit test for serialization / deserialization."
...
This reverts commit a2acd88efe
.
8 years ago
Sam Mousa
8ae207c3a1
Fixes #13837 : Refactored masking of CSRF tokens
8 years ago
Alexander Makarov
a626440761
Reverted #13822 , clarified exception descriptions
8 years ago
Sam Mousa
a2acd88efe
Moved serialization of `Cookie` to `Cookie`. Added unit test for serialization / deserialization.
8 years ago
Kolyunya
a35eada199
Fix tests of a web response
8 years ago
Nikolay Oleynikov
ea75068a92
Fixes #13813 : Fixed PHP 7 compatibiltiy by adding support for passing instances of `Error` to the `yii\web\Response::setStatusCodeByException()`
8 years ago
Nikolay Oleynikov
7a2f04ae32
Fixes #13822 : Fixed `yii\web\User::loginRequired()` to throw an `UnauthorizedHttpException` instead of a `ForbiddenHttpException`
8 years ago
Alexander Makarov
bc59d5da85
Fixes #13707 : Fixed `\yii\web\ErrorHandler` and `\yii\web\ErrorAction` not setting correct response code to response object before rendering error view
8 years ago
Alexander Makarov
3f8e8a89eb
Used more specific unit test assertions in framework tests
8 years ago
gagatust
6397791513
Fixed whitespaces to match code style [skip ci]
8 years ago
Nikolay Oleynikov
1cb1a978f2
Remove imports of inexistent classes
8 years ago
Robert Korulczyk
c8a323af81
Remove UrlRule::$trailingSlashForDefaults property.
8 years ago
Dmitry Naumenko
7206b2ba8a
Added assertion in UrlRuleTest to verify #13656
8 years ago
SilverFire - Dmitry Naumenko
f496567735
Fixed `yii\web\CacheSession::destroySession()` to work correctly when session is not written yet
...
Fixes #13537
8 years ago
Robert Korulczyk
bf841b926d
Additional tests.
8 years ago
Robert Korulczyk
8d4a197d19
Fix bug with creating URL in UrlRule with optional params at the beginning of pattern.
8 years ago
Robert Korulczyk
5d81af21fb
Fix bug with optional params at the beginning of pattern in UrlRule.
8 years ago
Nikolay Oleynikov
323568c2e9
Remove trailing spaces from sources and tests ( #13621 ) [skip ci]
8 years ago
Kolyunya
edc7a55692
Add a failing test to the `yii\web\UrlRule`
8 years ago
Carsten Brandt
e82b40abee
avoid duplicate slashes on empty values
...
fixes #13522
close #13525
8 years ago
Carsten Brandt
456d23272c
added failing test for #13522
...
regression after 2.0.11 release.
8 years ago
Carsten Brandt
a7f8d0efb4
added test for #12697
8 years ago
ErickSkrauch
c641513583
Implementation of support UrlRule with relative host definition
...
close #12697
fixes #12691
8 years ago
Carsten Brandt
8faedcbd7c
Refactored UrlManagerTest to cover more use cases
...
UrlManager is a complex class with a large bunch of options that needs
to be tested
and we had a few regressions in the past even though there are already a
lot of tests
covering it. Test coverage measured by lines does not help us determine
how good it is tested,
we need test coverage for every major path through the code.
I have refactored the UrlManager tests to reflect the different options
and cases to
have a better overview of which cases are covered and which are not.
UrlManager has two main operation modes:
- "default" url format, which is the simple case. These are covered by
methods in `UrlManagerTest`.
- "pretty" url format. This is the complex case, which involves UrlRules
and url parsing.
I have created two separate classes for this case:
Url creation for "pretty" url format is covered by
`UrlManagerCreateUrlTest`.
Url parsing for "pretty" url format is covered by
`UrlManagerParseUrlTest`.
Each of the test classes have a `getUrlManager` method that creates a
UrlManager instance
with a specific configuration and certain variations in options.
It is also tested that options that are not relevant in a certain
operation mode have no effect on the result.
To make sure to not remove tests that have existed before, here is a map
of where code has been moved.
The following test methods existed in the [old test
class](4187718c14/tests/framework/web/UrlManagerTest.php
):
- `testCreateUrl()` split between UrlManagerTest and
UrlManagerCreateUrlTest variations should all be covered by
`variationsProvider()`.
- `testCreateUrlWithNullParams()` covered by UrlManagerCreateUrlTest by
`testWithNullParams()`
- `testCreateUrlWithEmptyPattern()`
- `testCreateAbsoluteUrl()` covered in UrlManagerCreateUrlTest by new
tests via `variationsProvider()`.
- `testCreateAbsoluteUrlWithSuffix()` covered in UrlManagerCreateUrlTest
by `testAbsolutePatterns`.
- `testParseRequest()` covered by UrlManagerParseUrlTest, UrlNormalizer
related parts moved to UrlNormalizerTest.
- `testParseRESTRequest()` moved to UrlManagerParseUrlTest
- `testHash()` covered in different tests in UrlManagerCreateUrlTest.
- `testMultipleHostsRules($host)` kept as is.
Before:
$ vendor/bin/phpunit tests/framework/web/UrlManagerTest.php
...
OK (12 tests, 89 assertions)
After:
$ vendor/bin/phpunit tests/framework/web/UrlManager*.php
...
OK (72 tests, 648 assertions)
8 years ago
Dmitriy Bashkarev
be4ebdd049
Fixes #13134 : Added logging URL rules (bashkarev)
8 years ago
Herbert Maschke
d4d6c1dabf
Tests for 13393 ( #13439 )
...
* add some unit tests regarding redirection for ResponseTest
* also tests yii\web\controller redirect
8 years ago
Herbert Maschke
a6da9d5da8
Added unit tests regarding redirection for ResponseTest ( #13437 )
8 years ago
Klimov Paul
c73de31a90
Fixed `yii\web\MultipartFormDataParser` adds an extra newline to every value
8 years ago
Robert Korulczyk
507cc52658
Allow omit default params on URL creation
...
Fixes #10970
8 years ago
Robert Korulczyk
6d277ddafb
Tests for create URLs with multiple domain rules. ( #13351 )
8 years ago
SilverFire - Dmitry Naumenko
f6b9aac0bf
Ehanced `yii\web\ErrorAction` test coverage
8 years ago
SilverFire - Dmitry Naumenko
24ad05de5b
Refactored `yii\web\ErrorAction` to make it reusable
8 years ago
Alexander Makarov
c33583aede
Fixed naming for #13214 as suggested by Paul
8 years ago
Klimov Paul
194577c55e
Code style fix
8 years ago
Alexander Makarov
2f7c1b36b5
Fixes #12419 : Added ability to remove root tag and object tags for `yii\web\XmlResponseFormatter`
8 years ago
zalatov
deea3cf798
Fixes #12854 : Added `RangeNotSatisfiableHttpException` to cover HTTP error 416 file request exceptions
8 years ago
Carsten Brandt
081ee7c5b1
Implemented shortcut methods for returning JSON and XML ( #13101 )
...
fixes #13036
8 years ago
Robert Korulczyk
2d91723934
Add support for creating protocol-relative URLs.
...
Improve phpdoc for protocol-relative URL creation.
Remove useless `is_string()` check.
8 years ago
Robert Korulczyk
4aa935e69e
Fixes #12055 : Changed `boolean` to `bool` and `integer` to `int` in phpdoc
8 years ago
Alexander Makarov
0ac321370b
Fixes #12856 : Fixed `yii\web\XmlResponseFormatter` to use `true` and `false` to represent booleans
8 years ago