Browse Source

Merge pull request #8102 from klimov-paul/simpler-test-dir-structure-2

Simplified tests directory structure
tags/2.0.4
Alexander Makarov 10 years ago
parent
commit
d8da4e7796
  1. 6
      .travis.yml
  2. 4
      phpunit.xml.dist
  3. 0
      tests/.gitignore
  4. 20
      tests/README.md
  5. 0
      tests/TestCase.php
  6. 0
      tests/assets/.gitignore
  7. 6
      tests/bootstrap.php
  8. 0
      tests/data/ar/ActiveRecord.php
  9. 0
      tests/data/ar/Animal.php
  10. 0
      tests/data/ar/Cat.php
  11. 0
      tests/data/ar/Category.php
  12. 0
      tests/data/ar/Customer.php
  13. 0
      tests/data/ar/CustomerQuery.php
  14. 0
      tests/data/ar/Dog.php
  15. 0
      tests/data/ar/Item.php
  16. 0
      tests/data/ar/NullValues.php
  17. 0
      tests/data/ar/Order.php
  18. 0
      tests/data/ar/OrderItem.php
  19. 0
      tests/data/ar/OrderItemWithNullFK.php
  20. 0
      tests/data/ar/OrderWithNullFK.php
  21. 0
      tests/data/ar/Profile.php
  22. 0
      tests/data/ar/Type.php
  23. 0
      tests/data/base/InvalidRulesModel.php
  24. 0
      tests/data/base/Singer.php
  25. 0
      tests/data/base/Speaker.php
  26. 0
      tests/data/config.php
  27. 0
      tests/data/console/controllers/fixtures/FirstFixture.php
  28. 0
      tests/data/console/controllers/fixtures/FixtureStorage.php
  29. 0
      tests/data/console/controllers/fixtures/GlobalFixture.php
  30. 0
      tests/data/console/controllers/fixtures/SecondFixture.php
  31. 0
      tests/data/cubrid.sql
  32. 0
      tests/data/i18n/messages/de-DE/test.php
  33. 0
      tests/data/i18n/messages/de/test.php
  34. 0
      tests/data/i18n/messages/en-US/test.php
  35. 0
      tests/data/i18n/messages/ru/test.php
  36. 0
      tests/data/i18n/test.mo
  37. 0
      tests/data/i18n/test.po
  38. 0
      tests/data/mssql.sql
  39. 0
      tests/data/mysql.sql
  40. 0
      tests/data/oci.sql
  41. 0
      tests/data/postgres.sql
  42. 0
      tests/data/sqlite.sql
  43. 0
      tests/data/travis/README.md
  44. 0
      tests/data/travis/apc-setup.sh
  45. 0
      tests/data/travis/cubrid-setup.sh
  46. 0
      tests/data/travis/cubrid-solo.rb
  47. 0
      tests/data/travis/memcache-setup.sh
  48. 0
      tests/data/validators/TestValidator.php
  49. 0
      tests/data/validators/models/FakedValidationModel.php
  50. 0
      tests/data/validators/models/ValidatorTestMainModel.php
  51. 0
      tests/data/validators/models/ValidatorTestRefModel.php
  52. 0
      tests/data/views/layout.php
  53. 0
      tests/data/views/rawlayout.php
  54. 0
      tests/data/views/simple.php
  55. 0
      tests/data/web/assets/.gitignore
  56. 0
      tests/data/web/data.txt
  57. 0
      tests/framework/BaseYiiTest.php
  58. 0
      tests/framework/ar/ActiveRecordTestTrait.php
  59. 0
      tests/framework/base/ActionFilterTest.php
  60. 0
      tests/framework/base/BehaviorTest.php
  61. 0
      tests/framework/base/ComponentTest.php
  62. 0
      tests/framework/base/DynamicModelTest.php
  63. 0
      tests/framework/base/EventTest.php
  64. 0
      tests/framework/base/ExposedSecurity.php
  65. 0
      tests/framework/base/ModelTest.php
  66. 0
      tests/framework/base/ObjectTest.php
  67. 0
      tests/framework/base/SecurityTest.php
  68. 0
      tests/framework/behaviors/SluggableBehaviorTest.php
  69. 0
      tests/framework/behaviors/TimestampBehaviorTest.php
  70. 0
      tests/framework/caching/ApcCacheTest.php
  71. 0
      tests/framework/caching/ArrayCacheTest.php
  72. 0
      tests/framework/caching/CacheTestCase.php
  73. 0
      tests/framework/caching/DbCacheTest.php
  74. 0
      tests/framework/caching/FileCacheTest.php
  75. 0
      tests/framework/caching/MemCacheTest.php
  76. 0
      tests/framework/caching/MemCachedTest.php
  77. 0
      tests/framework/caching/TagDependencyTest.php
  78. 0
      tests/framework/caching/WinCacheTest.php
  79. 0
      tests/framework/caching/XCacheTest.php
  80. 0
      tests/framework/caching/ZendDataCacheTest.php
  81. 0
      tests/framework/console/controllers/AssetControllerTest.php
  82. 0
      tests/framework/console/controllers/BaseMessageControllerTest.php
  83. 0
      tests/framework/console/controllers/CacheControllerTest.php
  84. 0
      tests/framework/console/controllers/EchoMigrateController.php
  85. 0
      tests/framework/console/controllers/FixtureControllerTest.php
  86. 0
      tests/framework/console/controllers/MigrateControllerTest.php
  87. 0
      tests/framework/console/controllers/MigrateControllerTestTrait.php
  88. 0
      tests/framework/console/controllers/PHPMessageControllerTest.php
  89. 0
      tests/framework/console/controllers/POMessageControllerTest.php
  90. 0
      tests/framework/console/controllers/SilencedCacheController.php
  91. 0
      tests/framework/console/controllers/StdOutBufferControllerTrait.php
  92. 0
      tests/framework/data/ActiveDataProviderTest.php
  93. 0
      tests/framework/data/ArrayDataProviderTest.php
  94. 0
      tests/framework/data/SortTest.php
  95. 0
      tests/framework/db/ActiveRecordTest.php
  96. 0
      tests/framework/db/BatchQueryResultTest.php
  97. 0
      tests/framework/db/CommandTest.php
  98. 0
      tests/framework/db/ConnectionTest.php
  99. 0
      tests/framework/db/DatabaseTestCase.php
  100. 0
      tests/framework/db/QueryBuilderTest.php
  101. Some files were not shown because too many files have changed in this diff Show More

6
.travis.yml

@ -42,9 +42,9 @@ install:
- export PATH="$HOME/.composer/vendor/bin:$PATH" - export PATH="$HOME/.composer/vendor/bin:$PATH"
# core framework: # core framework:
- travis_retry composer install --prefer-dist --no-interaction - travis_retry composer install --prefer-dist --no-interaction
- tests/unit/data/travis/apc-setup.sh - tests/data/travis/apc-setup.sh
- tests/unit/data/travis/memcache-setup.sh - tests/data/travis/memcache-setup.sh
# - tests/unit/data/travis/cubrid-setup.sh # - tests/data/travis/cubrid-setup.sh
before_script: before_script:
# show some versions and env information # show some versions and env information

4
phpunit.xml.dist

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./tests/unit/bootstrap.php" <phpunit bootstrap="./tests/bootstrap.php"
colors="true" colors="true"
convertErrorsToExceptions="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertNoticesToExceptions="true"
@ -7,7 +7,7 @@
stopOnFailure="false"> stopOnFailure="false">
<testsuites> <testsuites>
<testsuite name="Yii Test Suite"> <testsuite name="Yii Test Suite">
<directory>./tests/unit</directory> <directory>./tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <filter>

0
tests/unit/.gitignore → tests/.gitignore vendored

20
tests/README.md

@ -4,12 +4,10 @@ Yii 2.0 Unit tests
DIRECTORY STRUCTURE DIRECTORY STRUCTURE
------------------- -------------------
unit/ Unit tests to run with PHPUnit data/ models, config and other test data
data/ models, config and other test data config.php this file contains configuration for database and caching backends
config.php this file contains configuration for database and caching backends framework/ the framework unit tests
framework/ the framework unit tests runtime/ the application runtime dir for the yii test app
runtime/ the application runtime dir for the yii test app
web/ webapp for functional testing
HOW TO RUN THE TESTS HOW TO RUN THE TESTS
@ -19,18 +17,24 @@ Make sure you have PHPUnit installed and that you installed all composer depende
Run PHPUnit in the yii repo base directory. Run PHPUnit in the yii repo base directory.
```php ```
phpunit phpunit
``` ```
You can run tests for specific groups only: You can run tests for specific groups only:
```php ```
phpunit --group=mysql,base,i18n phpunit --group=mysql,base,i18n
``` ```
You can get a list of available groups via `phpunit --list-groups`. You can get a list of available groups via `phpunit --list-groups`.
A single test class could be run like the follwing:
```
phpunit tests/framework/base/ObjectTest.php
```
TEST CONFIGURATION TEST CONFIGURATION
------------------ ------------------

0
tests/unit/TestCase.php → tests/TestCase.php

0
tests/unit/assets/.gitignore → tests/assets/.gitignore vendored

6
tests/unit/bootstrap.php → tests/bootstrap.php

@ -9,13 +9,13 @@ $_SERVER['SCRIPT_NAME'] = '/' . __DIR__;
$_SERVER['SCRIPT_FILENAME'] = __FILE__; $_SERVER['SCRIPT_FILENAME'] = __FILE__;
// require composer autoloader if available // require composer autoloader if available
$composerAutoload = __DIR__ . '/../../vendor/autoload.php'; $composerAutoload = __DIR__ . '/../vendor/autoload.php';
if (is_file($composerAutoload)) { if (is_file($composerAutoload)) {
require_once($composerAutoload); require_once($composerAutoload);
} else { } else {
require_once(__DIR__ . '/../../../../autoload.php'); require_once(__DIR__ . '/../../../autoload.php');
} }
require_once(__DIR__ . '/../../framework/Yii.php'); require_once(__DIR__ . '/../framework/Yii.php');
Yii::setAlias('@yiiunit', __DIR__); Yii::setAlias('@yiiunit', __DIR__);

0
tests/unit/data/ar/ActiveRecord.php → tests/data/ar/ActiveRecord.php

0
tests/unit/data/ar/Animal.php → tests/data/ar/Animal.php

0
tests/unit/data/ar/Cat.php → tests/data/ar/Cat.php

0
tests/unit/data/ar/Category.php → tests/data/ar/Category.php

0
tests/unit/data/ar/Customer.php → tests/data/ar/Customer.php

0
tests/unit/data/ar/CustomerQuery.php → tests/data/ar/CustomerQuery.php

0
tests/unit/data/ar/Dog.php → tests/data/ar/Dog.php

0
tests/unit/data/ar/Item.php → tests/data/ar/Item.php

0
tests/unit/data/ar/NullValues.php → tests/data/ar/NullValues.php

0
tests/unit/data/ar/Order.php → tests/data/ar/Order.php

0
tests/unit/data/ar/OrderItem.php → tests/data/ar/OrderItem.php

0
tests/unit/data/ar/OrderItemWithNullFK.php → tests/data/ar/OrderItemWithNullFK.php

0
tests/unit/data/ar/OrderWithNullFK.php → tests/data/ar/OrderWithNullFK.php

0
tests/unit/data/ar/Profile.php → tests/data/ar/Profile.php

0
tests/unit/data/ar/Type.php → tests/data/ar/Type.php

0
tests/unit/data/base/InvalidRulesModel.php → tests/data/base/InvalidRulesModel.php

0
tests/unit/data/base/Singer.php → tests/data/base/Singer.php

0
tests/unit/data/base/Speaker.php → tests/data/base/Speaker.php

0
tests/unit/data/config.php → tests/data/config.php

0
tests/unit/data/console/controllers/fixtures/FirstFixture.php → tests/data/console/controllers/fixtures/FirstFixture.php

0
tests/unit/data/console/controllers/fixtures/FixtureStorage.php → tests/data/console/controllers/fixtures/FixtureStorage.php

0
tests/unit/data/console/controllers/fixtures/GlobalFixture.php → tests/data/console/controllers/fixtures/GlobalFixture.php

0
tests/unit/data/console/controllers/fixtures/SecondFixture.php → tests/data/console/controllers/fixtures/SecondFixture.php

0
tests/unit/data/cubrid.sql → tests/data/cubrid.sql

0
tests/unit/data/i18n/messages/de-DE/test.php → tests/data/i18n/messages/de-DE/test.php

0
tests/unit/data/i18n/messages/de/test.php → tests/data/i18n/messages/de/test.php

0
tests/unit/data/i18n/messages/en-US/test.php → tests/data/i18n/messages/en-US/test.php

0
tests/unit/data/i18n/messages/ru/test.php → tests/data/i18n/messages/ru/test.php

0
tests/unit/data/i18n/test.mo → tests/data/i18n/test.mo

0
tests/unit/data/i18n/test.po → tests/data/i18n/test.po

0
tests/unit/data/mssql.sql → tests/data/mssql.sql

0
tests/unit/data/mysql.sql → tests/data/mysql.sql

0
tests/unit/data/oci.sql → tests/data/oci.sql

0
tests/unit/data/postgres.sql → tests/data/postgres.sql

0
tests/unit/data/sqlite.sql → tests/data/sqlite.sql

0
tests/unit/data/travis/README.md → tests/data/travis/README.md

0
tests/unit/data/travis/apc-setup.sh → tests/data/travis/apc-setup.sh

0
tests/unit/data/travis/cubrid-setup.sh → tests/data/travis/cubrid-setup.sh

0
tests/unit/data/travis/cubrid-solo.rb → tests/data/travis/cubrid-solo.rb

0
tests/unit/data/travis/memcache-setup.sh → tests/data/travis/memcache-setup.sh

0
tests/unit/data/validators/TestValidator.php → tests/data/validators/TestValidator.php

0
tests/unit/data/validators/models/FakedValidationModel.php → tests/data/validators/models/FakedValidationModel.php

0
tests/unit/data/validators/models/ValidatorTestMainModel.php → tests/data/validators/models/ValidatorTestMainModel.php

0
tests/unit/data/validators/models/ValidatorTestRefModel.php → tests/data/validators/models/ValidatorTestRefModel.php

0
tests/unit/data/views/layout.php → tests/data/views/layout.php

0
tests/unit/data/views/rawlayout.php → tests/data/views/rawlayout.php

0
tests/unit/data/views/simple.php → tests/data/views/simple.php

0
tests/unit/data/web/assets/.gitignore → tests/data/web/assets/.gitignore vendored

0
tests/unit/data/web/data.txt → tests/data/web/data.txt

0
tests/unit/framework/BaseYiiTest.php → tests/framework/BaseYiiTest.php

0
tests/unit/framework/ar/ActiveRecordTestTrait.php → tests/framework/ar/ActiveRecordTestTrait.php

0
tests/unit/framework/base/ActionFilterTest.php → tests/framework/base/ActionFilterTest.php

0
tests/unit/framework/base/BehaviorTest.php → tests/framework/base/BehaviorTest.php

0
tests/unit/framework/base/ComponentTest.php → tests/framework/base/ComponentTest.php

0
tests/unit/framework/base/DynamicModelTest.php → tests/framework/base/DynamicModelTest.php

0
tests/unit/framework/base/EventTest.php → tests/framework/base/EventTest.php

0
tests/unit/framework/base/ExposedSecurity.php → tests/framework/base/ExposedSecurity.php

0
tests/unit/framework/base/ModelTest.php → tests/framework/base/ModelTest.php

0
tests/unit/framework/base/ObjectTest.php → tests/framework/base/ObjectTest.php

0
tests/unit/framework/base/SecurityTest.php → tests/framework/base/SecurityTest.php

0
tests/unit/framework/behaviors/SluggableBehaviorTest.php → tests/framework/behaviors/SluggableBehaviorTest.php

0
tests/unit/framework/behaviors/TimestampBehaviorTest.php → tests/framework/behaviors/TimestampBehaviorTest.php

0
tests/unit/framework/caching/ApcCacheTest.php → tests/framework/caching/ApcCacheTest.php

0
tests/unit/framework/caching/ArrayCacheTest.php → tests/framework/caching/ArrayCacheTest.php

0
tests/unit/framework/caching/CacheTestCase.php → tests/framework/caching/CacheTestCase.php

0
tests/unit/framework/caching/DbCacheTest.php → tests/framework/caching/DbCacheTest.php

0
tests/unit/framework/caching/FileCacheTest.php → tests/framework/caching/FileCacheTest.php

0
tests/unit/framework/caching/MemCacheTest.php → tests/framework/caching/MemCacheTest.php

0
tests/unit/framework/caching/MemCachedTest.php → tests/framework/caching/MemCachedTest.php

0
tests/unit/framework/caching/TagDependencyTest.php → tests/framework/caching/TagDependencyTest.php

0
tests/unit/framework/caching/WinCacheTest.php → tests/framework/caching/WinCacheTest.php

0
tests/unit/framework/caching/XCacheTest.php → tests/framework/caching/XCacheTest.php

0
tests/unit/framework/caching/ZendDataCacheTest.php → tests/framework/caching/ZendDataCacheTest.php

0
tests/unit/framework/console/controllers/AssetControllerTest.php → tests/framework/console/controllers/AssetControllerTest.php

0
tests/unit/framework/console/controllers/BaseMessageControllerTest.php → tests/framework/console/controllers/BaseMessageControllerTest.php

0
tests/unit/framework/console/controllers/CacheControllerTest.php → tests/framework/console/controllers/CacheControllerTest.php

0
tests/unit/framework/console/controllers/EchoMigrateController.php → tests/framework/console/controllers/EchoMigrateController.php

0
tests/unit/framework/console/controllers/FixtureControllerTest.php → tests/framework/console/controllers/FixtureControllerTest.php

0
tests/unit/framework/console/controllers/MigrateControllerTest.php → tests/framework/console/controllers/MigrateControllerTest.php

0
tests/unit/framework/console/controllers/MigrateControllerTestTrait.php → tests/framework/console/controllers/MigrateControllerTestTrait.php

0
tests/unit/framework/console/controllers/PHPMessageControllerTest.php → tests/framework/console/controllers/PHPMessageControllerTest.php

0
tests/unit/framework/console/controllers/POMessageControllerTest.php → tests/framework/console/controllers/POMessageControllerTest.php

0
tests/unit/framework/console/controllers/SilencedCacheController.php → tests/framework/console/controllers/SilencedCacheController.php

0
tests/unit/framework/console/controllers/StdOutBufferControllerTrait.php → tests/framework/console/controllers/StdOutBufferControllerTrait.php

0
tests/unit/framework/data/ActiveDataProviderTest.php → tests/framework/data/ActiveDataProviderTest.php

0
tests/unit/framework/data/ArrayDataProviderTest.php → tests/framework/data/ArrayDataProviderTest.php

0
tests/unit/framework/data/SortTest.php → tests/framework/data/SortTest.php

0
tests/unit/framework/db/ActiveRecordTest.php → tests/framework/db/ActiveRecordTest.php

0
tests/unit/framework/db/BatchQueryResultTest.php → tests/framework/db/BatchQueryResultTest.php

0
tests/unit/framework/db/CommandTest.php → tests/framework/db/CommandTest.php

0
tests/unit/framework/db/ConnectionTest.php → tests/framework/db/ConnectionTest.php

0
tests/unit/framework/db/DatabaseTestCase.php → tests/framework/db/DatabaseTestCase.php

0
tests/unit/framework/db/QueryBuilderTest.php → tests/framework/db/QueryBuilderTest.php

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save