Commit graph

842 commits

Author SHA1 Message Date
mark_story
2d68e7da1e Fix failing tests.
You can't use finfo on files that don't exist.
2011-12-18 23:26:57 -05:00
mark_story
f959fcefc4 Add File::mime()
Fixes #1051
2011-12-18 23:02:05 -05:00
Kyle Robinson Young
c93dab69a3 Correct placement of between on FormHelper radio and input
Fixes #1992
2011-12-18 08:25:42 -08:00
ADmad
1358af783b Added test case for TreeBehavior::recover(). Refs #2392 2011-12-18 15:23:49 +05:30
mark_story
0607437abd Fix various failing tests. 2011-12-17 23:50:41 -05:00
mark_story
e9779e7126 Fix failing test in Debugger test case. 2011-12-17 22:53:21 -05:00
mark_story
46bb6c8ad6 Adding tests and functionality for nested blocks. 2011-12-17 22:23:37 -05:00
mark_story
f0f3eb9ba9 Fix a few outstanding issues with blocks.
- Blocks left open after rendering files should trigger
  an exception.
- Fix strict errors.
- Correct doc blocks.
2011-12-17 22:23:37 -05:00
mark_story
bcb8444ab1 Make CacheHelper able to handle nocache tags in elements.
Using afterRenderFile() instead of afterRender() allows
CacheHelper to parse content in elements and extended views.
2011-12-17 22:23:37 -05:00
mark_story
fb20841d25 Doing some internal re-factoring in CacheHelper.
cache() should only do one thing.
It shouldn't do more work than is necessary each time its called.
Flatten some of the conditions by extracting methods.
2011-12-17 22:23:37 -05:00
mark_story
c5c2859800 Fixing failing tests. 2011-12-17 22:23:36 -05:00
mark_story
c49e261eba Adding new callbacks into View. 2011-12-17 22:23:36 -05:00
mark_story
e06895ef91 Adding view files for tests.
Adding test case for elements + extending
Making elements extend each other.
2011-12-17 22:23:35 -05:00
mark_story
b6919a0268 Starting the extend() feature.
Adding a simple test case.
Still need to add callbacks around every view fragment rendered.
Without that CacheHelper will not be able to cache extended views
correctly.
2011-12-17 22:23:35 -05:00
mark_story
b866c00318 Renaming methods so they are shorter and still make sense. 2011-12-17 22:23:35 -05:00
mark_story
82139fe8f6 Updating HtmlHelper to allow custom blocks.
Adding tests for blocks.
Adding missing tests.
2011-12-17 22:23:34 -05:00
mark_story
7854f9dd52 Add View::getBlock()
View::get() had two jobs.  That's almost always a bad thing.
Add a new method instead.
2011-12-17 22:23:34 -05:00
Mark Story
4606ea39a9 Updating HtmlHelper and its tests to use View::append(). 2011-12-17 22:23:34 -05:00
Mark Story
bd4ee41e24 Deprecating addScript() its replaced by blocks feature.
Adding View::blocks() for getting the list of blocks.
2011-12-17 22:23:33 -05:00
Mark Story
9107913c07 Implementing basic features of view 'blocks' 2011-12-17 22:23:33 -05:00
Mark Story
3e2bde523b Adding tests for Blocks in View.
Blocks should replace scripts_for_layout and content_for_layout
in a future version of CakePHP.
2011-12-17 22:23:33 -05:00
mark_story
e05d7d1791 Make dispatcher::cached() use here()
This allows separate cache files to be created
for different query parameters.

Fixes #2381
2011-12-17 12:19:34 -05:00
mark_story
a71b0f9867 Adding test for CacheHelper.
Refs #2381
2011-12-17 12:09:50 -05:00
Kyle Robinson Young
d794084d38 More code standards formatting 2011-12-15 23:00:07 -08:00
Kyle Robinson Young
51f9837db4 Code standards formatting 2011-12-15 22:52:07 -08:00
mark_story
f1b566b88e Fix failing tests.
Remove duplicated test.
2011-12-15 23:45:13 -05:00
Ceeram
3f8934634b remove cheating, sort() always returns true 2011-12-15 01:18:11 +01:00
ADmad
01b04314c9 Fixing possible test case failure 2011-12-15 03:20:09 +05:30
ADmad
16d29a8d0e Making Folder::delete() code more PHP5ish 2011-12-15 03:07:17 +05:30
Rachman Chavik
a8d0447e61 fix fullTableName duplicate prefix, closes #2355 2011-12-14 14:35:20 +07:00
Kyle Robinson Young
060e225b76 Add test for Model::getID(), simplify return and remove dated @see link 2011-12-13 22:19:50 -08:00
mark_story
cfb6ed4cda Fix failing tests. 2011-12-13 22:11:06 -05:00
mark_story
07a2a60468 Merge branch '2.0' into 2.1 2011-12-13 22:03:40 -05:00
mark_story
b61e3e0378 Fix lies in Shell::createFile()
It could lie if the file was not writable.

Fixes #2371
2011-12-13 21:59:58 -05:00
mark_story
8d1edd72f2 Moving tests and un-skipping them.
Adding tests for proper field quoting in conditions.
Closes #2369
2011-12-13 21:26:03 -05:00
Rachman Chavik
d77f9aacde updating multidb tests to use ConnectionManager 2011-12-13 21:10:16 +07:00
Rachman Chavik
a88ca54a8d updating usage of assertEqual -> assertEquals 2011-12-13 21:03:40 +07:00
Kyle Robinson Young
b46c4b3e3f Correcting assertEquals parameter order 2011-12-12 20:35:31 -08:00
mark_story
645ef47878 Fix multiple date formats in Validation::date()
Fixes #2364
2011-12-12 20:21:10 -05:00
Rachman Chavik
8b4e79c795 adding tests for LH 275
ported to 2.0 branch from cakephp/cakephp#93
2011-12-12 18:18:02 +07:00
mark_story
ab5bfdccfd Fix bad merge and failing test. 2011-12-11 23:20:19 -05:00
mark_story
d63d51e3dd Fix failing tests caused by incorrect mocks. 2011-12-11 23:07:01 -05:00
mark_story
2e8498e166 Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Model/Datasource/Database/Postgres.php
	lib/Cake/Test/Case/Console/TaskCollectionTest.php
	lib/Cake/Test/Case/Model/ModelIntegrationTest.php
	lib/Cake/Test/Case/Utility/ClassRegistryTest.php
	lib/Cake/Utility/ClassRegistry.php
2011-12-11 22:51:40 -05:00
mark_story
8bb6f8803c Fix infinite loop when minYear/maxYear are not int.
Refs #2361
2011-12-11 22:11:14 -05:00
mark_story
205bfb506f Add Shell::$plugin and update getOptionParser()
Adding a plugin property allows the correct
usage/help information to be generated.

Fixes #2359
2011-12-10 21:31:21 -05:00
José Lorenzo Rodríguez
47b2f3e70c Merge pull request #371 from shama/patch-caketestsuite
Add tests for CakeTestSuite and dont include hidden folders when recursively addTestFile
2011-12-10 10:57:08 -08:00
Jose Lorenzo Rodriguez
cf03b33a0d Properly using sort() before asserting values, asserting the result of sort() is cheating :P 2011-12-10 10:38:24 -04:30
Ceeram
1eb55bc201 ensure test pass when files are returned in different order 2011-12-10 14:26:14 +01:00
Kyle Robinson Young
7fa1984a43 Add tests for CakeTestSuite and dont include hidden folders when recursively addTestFile 2011-12-09 23:27:17 -08:00
Kyle Robinson Young
97fbcd1079 Add test case for Folder::tree with hidden files 2011-12-09 21:44:15 -08:00
mark_story
b7f6645cec Fix issue with url parsing and /?
PHP's parse_url fails to parse url's containing
`/?`.  It returns false instead of something useful.

Fixes #2354
2011-12-08 21:48:40 -05:00
mark_story
bbd6e22e26 Add test for FormHelper::select() + 0
Closes #2352
2011-12-08 20:15:54 -05:00
ADmad
df097796c4 Fixing incorrect setting of default value for 'onDomReady' option in JsHelper::writeBuffer() 2011-12-08 14:03:39 +05:30
Jose Lorenzo Rodriguez
73aeb6ba62 Lazy-loading the $tablePrefix property in models, Fixes #2277 2011-12-08 00:10:22 -04:30
mark_story
64eb38a953 Fix disabled + SecurityComponent
Disabled inputs should be omitted from the secured fields.
This will enable forms to submit successfully as long as those
inputs stay excluded from the form submission.

Fixes #2333
2011-12-07 22:30:40 -05:00
mark_story
bc8ae11fc1 Fix fatal error with abstract/interface classes
Abstract/Interface classes + ClassRegistry::init() should
raise an exception, not cause fatal errors.

Update CakeSchema to swallow and ignore any exceptions coming from
ClassRegistry.

Fixes #2328
2011-12-07 20:58:01 -05:00
Kyle Robinson Young
1e1c7a036d Code consistency formatting tweaks 2011-12-06 12:52:48 -08:00
mark_story
495b7f279f Adding test for #2345 2011-12-06 21:06:45 -05:00
Kyle Robinson Young
7f22fcdbf5 Fix TextHelper excerpt method to work as documented
Fixes #2339
2011-12-05 12:12:09 -08:00
Mark Story
ba81754a1a Merge pull request #352 from shama/patch-cakeschema-test-fix
CakeSchemaTest: Skip testSchemaReadWithConfigPrefix test if an existing prefix has been set
2011-12-05 11:46:47 -08:00
Mark Story
a32eabe492 Merge pull request #355 from shama/patch-casing
Consistently setting setUp() and tearDown() on test cases
2011-12-05 11:44:15 -08:00
Ceeram
3b8990ffca Fix other failing test by 1 second difference 2011-12-05 17:13:22 +01:00
Ceeram
09a623e07b Fix failing tests by 1 second difference 2011-12-05 17:11:41 +01:00
Ceeram
e4e26a852b Making non-interactive behave same as interactive with odd table names 2011-12-05 17:00:48 +01:00
ADmad
a062135d87 Merge pull request #354 from shama/patch-databasesession-test-fix
Fix DatabaseSessionTest garbage collection test case
2011-12-05 06:00:59 -08:00
ADmad
72497147bd Changing default docType to 'html5' 2011-12-05 07:04:00 +05:30
Kyle Robinson Young
5388237099 Consistently setting setUp() and tearDown() on test cases 2011-12-04 13:27:51 -08:00
Kyle Robinson Young
66b3e9a7c9 Fix DatabaseSessionTest garbage collection test case 2011-12-04 13:04:42 -08:00
Kyle Robinson Young
8e70f4ac12 Fix CakeSession testCheckKeyWithSpaces and testUsingPluginHandler test cases 2011-12-04 12:43:27 -08:00
Kyle Robinson Young
42583ff6a5 Skip testSchemaReadWithConfigPrefix test if an existing prefix has already been set 2011-12-04 12:10:01 -08:00
mark_story
9296f770d5 Adding SecurityComponent::$csrfLimit
This property allows you to control the number of tokens
that will be kept active.  Its possible to make really large
CSRF collection sizes.  Capping the number of tokens allows developers
to better control session sizes.
2011-12-03 20:13:17 -05:00
mark_story
e421b3bc8f Adding SecurityComponent::generateToken()
This method allows end developers to add the csrf tokens
manually, if they aren't added automatically.

Tokens are cheap to generate, simplifying the logic
makes things a bit easier to understand.
2011-12-03 20:13:03 -05:00
mark_story
71b41ed91c Unskip some tests. 2011-12-03 15:00:06 -05:00
mark_story
6d269ce25d Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Config/config.php
	lib/Cake/Console/Command/Task/ModelTask.php
	lib/Cake/Console/Command/TestsuiteShell.php
	lib/Cake/Model/CakeSchema.php
	lib/Cake/Model/Datasource/Database/Sqlite.php
	lib/Cake/Test/Case/Model/ModelTestBase.php
	lib/Cake/Test/Case/Routing/DispatcherTest.php
	lib/Cake/Test/Case/Utility/FileTest.php
	lib/Cake/VERSION.txt
2011-12-03 13:45:28 -05:00
mark_story
22352a0227 Fix missing directory in dispatcher with rewrite off.
When re-writing is disabled, and the deployment directory
contains either 'app' or 'webroot' the computed path was
incorrect.

Fixes #2330
2011-12-02 23:39:33 -05:00
mark_story
0f71254fe1 Fix double inflection in bake all <foo>
ViewTask re-pluralizes the model name.  Sometimes this leads to
things like Menuses which is totally wrong.

Fixes #2318
2011-12-01 20:41:17 -05:00
mark_story
8b3c72f7c1 Fix issue with nested named parameters.
Nested named parameters were not being correctly flattened.

Fixes #2329
2011-12-01 20:32:28 -05:00
mark_story
79d6a850ad Fix theme files with spaces in them.
Fixes #2324
2011-12-01 18:16:01 -05:00
Kyle Robinson Young
94e119fe67 Adhere to code formatting standard 2011-11-30 23:21:31 -08:00
mark_story
49708ec837 Fix cachefiles being generated with "
Cache files with SQLite should not contain "

Fixes #2323
2011-11-30 21:56:25 -05:00
mark_story
4b292b139e Fix build, I'm a dork. 2011-11-30 21:00:07 -05:00
ADmad
166e03e7de Merge pull request #344 from majna/2.0-controller-template
Add visibility keyword for 'helpers' property in controller template.
2011-11-30 11:18:52 -08:00
Majna
87a3937def Add visibility keyword for 'helpers' property in controller template. 2011-11-30 20:06:07 +01:00
Ceeram
b5c4b85601 Fixing cascading delete, when using foreignKey false and setting condition on hasOne. 2011-11-30 20:02:36 +01:00
Kyle Robinson Young
5876744709 Adhering to coding standards 2011-11-30 07:44:11 -08:00
mark_story
7f68699fcd Fix return values in Cache.
The documentation indicates that false/or the value will be returnned.
Using both null and false to indicate failure is confusing.  Use only
false to indicate failure.  It might be better in the future to use
exceptions for trying to read/write on missing cache configs.
2011-11-29 23:17:17 -05:00
Renan Gonçalves
8568ac6613 Trying to take into account the number of days in a month. 2011-11-30 01:14:39 +01:00
Jose Lorenzo Rodriguez
76e334ca38 Merge branch '2.1' of github.com:cakephp/cakephp into 2.1 2011-11-28 22:30:36 -04:30
mark_story
a56ad0ccac Fixing failing tests. 2011-11-28 21:36:44 -05:00
Ceeram
57a1a2814d Fixing modeltask to use correct table
ModelTask will now bake correct primaryKey when not id
2011-11-29 00:00:00 +01:00
Jose Lorenzo Rodriguez
8f1125ed4d Merge branch '2.0' of github.com:cakephp/cakephp into 2.0 2011-11-28 00:54:16 -04:30
Jose Lorenzo Rodriguez
f6534d2962 Fixing issue where changing the case for an action in the url would allow the action in the AuthComponent making it accessible to not-logged in users 2011-11-28 00:52:47 -04:30
mark_story
6e1b1df2b2 Change serialize to _serialize
Its possible that a developer would use 'serialize' as a legitimate
view variable.  Prefix with an _ to minimize that.
2011-11-27 23:51:49 -05:00
mark_story
04463c4ee5 Fix errors found in review. 2011-11-27 23:51:49 -05:00
mark_story
50ec08f9bd Adding support for array serialize values.
Using an array for 'serialize' gives a set of view vars
to convert into the view output.
2011-11-27 23:51:49 -05:00
mark_story
b0d0e06b97 Update RequestHandler tests for new View classes. 2011-11-27 23:51:49 -05:00
mark_story
c1f5dc1e40 Make XmlView consistent with JsonView.
Both allow a view script or a serialize key with the name
of the variable to be serialized.
2011-11-27 23:51:48 -05:00
mark_story
5e9b1583e5 Making JsonView work more like the XmlView. 2011-11-27 23:51:48 -05:00
mark_story
c64e41eb45 Fix casing of vars in tests. 2011-11-27 23:51:48 -05:00
Juan Basso
a6c1aafcc4 Added XmlView. 2011-11-27 23:51:47 -05:00
Juan Basso
873489053c Not loading helpers and others stuffs not necessary to Json view. Tests added. 2011-11-27 23:51:47 -05:00
mark_story
390db7beba Fix issue with dots in request URLs.
Dots in request url's often resulted in an additional get parameter
being added.

Fixes #2303
2011-11-26 21:24:53 -05:00
m
fb3d3ca943 Add test for XML.
Test xml with multiple model results
Fixes #2304
2011-11-26 14:43:19 -05:00
mark_story
54aef7216f Add failing test for #2188 2011-11-25 21:19:31 -05:00
ADmad
73674c648c Moving AppShell inside Console/Command for consistency with file location of other App classes. Also making all core shells and tasks extends AppShell instead of Shell. Closes #2278 2011-11-26 02:48:49 +05:30
Rachman Chavik
1677e87512 fixing broken tests: update expected regex pattern 2011-11-25 22:36:44 +07:00
Rachman Chavik
1f7c292651 fixing broken tests: updating fullTableName() use
At the same time, reversing arguments since phpunit wants 'expected' as
the first parameter.
2011-11-25 22:36:44 +07:00
Rachman Chavik
c4cbf1c635 Adding cross schema test 2011-11-25 22:29:23 +07:00
mark_story
5180540d1f Fix protocol relative urls for CSS and JS files.
Protocol relative urls are generally not on the same host
don't try and run them through the asset filters.

Fixes #2285
2011-11-24 21:04:57 -05:00
Ceeram
179a5c8559 remove order, which was required with setting default order on CakeTestModel 2011-11-24 22:20:29 +01:00
mark_story
2969a8f6ac Make a few more tests run in AllTests. 2011-11-23 21:30:28 -05:00
mark_story
07462f0bef Fix nested name attributes for submit()
Nested name attributes and Security component did not co-operate.

Fixes #2271
2011-11-23 20:40:25 -05:00
Ceeram
05940ae1ec adding default order on id to CakeTestModel, to ensure correct order. Postgres can return results in any order it considers appropriate if none specified 2011-11-22 21:50:17 +01:00
Ceeram
f57c287c43 fixing test to ensure tests dont fail on 1 second timestamp diff 2011-11-22 17:21:00 +01:00
Ceeram
7d6637f55b ensure test doesnt fail by 1 second diff in timestamp 2011-11-22 10:57:36 +01:00
ADmad
0e6697dbc6 Skipping failing test when run through web browser. 2011-11-22 02:00:58 +05:30
mark_story
6d6ac10834 Fix failing tests caused by previous commit. 2011-11-20 23:00:58 -05:00
mark_story
21cd3f00ac Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Test/Case/BasicsTest.php
2011-11-19 20:40:07 -05:00
AD7six
8e38f666b7 allow baking models with missing tables - even for rdbms
test updated to reflect expected new expected behavior. If you bake a
model with the table missing, if forced to run skip any part of the
process that would result in an exception.
2011-11-20 01:11:33 +01:00
mark_story
95b85118c7 Fix issue with button() and nested name attributes.
Buttons with nested name attributes were not properly unlocked
and caused SecurityComponent to black hole the request.

Fixes #2271
2011-11-19 11:43:09 -05:00
mark_story
c8ab4ad05b Fix issue in TimeHelper with translated values.
LC_TIME files using unicode code points would incorrectly display.
Use either the Multibyte class or mbstring to correctly detect
and convert values.

Fixes #912

Conflicts:

	lib/Cake/View/Helper/TimeHelper.php
2011-11-19 10:12:05 -05:00
m
2957a33b23 assertEqual to assertEquals in core test files
Signed-off-by: mark_story <mark@mark-story.com>
2011-11-19 09:25:03 -05:00
mark_story
cb49b242ae Fix issue in Router with prefixes.
Prefixes should not be interpreted as named parameters.
Fixes #2269
2011-11-17 20:30:34 -05:00
Ceeram
0f299a1542 use old timestamp variable, to ensure test to pass 2011-11-17 13:09:03 +01:00
ADmad
90b007ef75 Implemented priority based triggering of callbacks for objects in collection 2011-11-17 12:36:54 +05:30
Jose Lorenzo Rodriguez
02912b6eeb Correctly getting connection configs in CakeSchemaTest 2011-11-17 01:03:46 -04:30
Rachman Chavik
aab8e98531 Configure ClassRegistry in test mode
CR::config accepts 'testing' key to indicate a test run.
When this flag is set, CR::init() will use 'test' datasource,
or append 'test_' prefix to a model's useDbConfig value if
the datasource configured.
2011-11-17 11:31:36 +07:00
Rachman Chavik
408e785d5e Display datasource name in exceptions and error page.
When working with multiple databases, it's helpful to display
the datasource name that is requested by a given model.
2011-11-17 11:24:45 +07:00
Rachman Chavik
073d04931a Adding tests for loading multischema fixtures 2011-11-17 11:24:45 +07:00
mark_story
2f599e8a2a Removing extra new lines.
Removing extra new lines and duplicated tests.
2011-11-16 21:51:49 -05:00
mark_story
fa0ec44dfd Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
	lib/Cake/Test/Case/Error/ExceptionRendererTest.php
	lib/Cake/Test/Case/Utility/DebuggerTest.php
	lib/Cake/Test/Case/View/Helper/TextHelperTest.php
2011-11-16 21:31:16 -05:00
Kyle Robinson Young
99793fd654 Test case compatibility skipUnless() to markTestSkipped() 2011-11-16 21:07:09 -05:00
Kyle Robinson Young
c97dca1570 Test case compatibility assertIsA() to assertInstanceOf() 2011-11-16 21:07:08 -05:00
Kyle Robinson Young
98f03dc6df Replacing test case compatibility functions 2011-11-16 21:07:08 -05:00
Mark Story
2c5350bb4b Merge pull request #297 from markomarkovic/73429b357f06cd76f35d81482dd789b1737fe2b9
Fixed inconsistent debug parameters and empty '(line )'
2011-11-16 17:56:05 -08:00
mark_story
9c5ad71abc Add CakeRequest::__isset()
Fixes #2266
2011-11-16 20:21:07 -05:00
Ceeram
e5c8a446d6 Add sorting on joined model virtual field, fixes #2250 2011-11-17 00:18:12 +01:00
Ceeram
3cb5188b2d Fix failing test, moving timestamp define before the save to ensure it cannot be off by a second 2011-11-16 13:16:36 +01:00
Ceeram
025133db32 Fix tests which might fail due to unexpected order on finds 2011-11-16 13:15:14 +01:00
ADmad
8450b8bbc4 Fixing TMP cleanup code in FolderTest 2011-11-16 14:03:18 +05:30
mark_story
542e5c91de Merge branch '2.1' of github.com:cakephp/cakephp into 2.1 2011-11-15 23:11:07 -05:00
mark_story
fb7d931bef Merge branch '2.0' into 2.1
Conflicts:
	lib/Cake/Config/config.php
	lib/Cake/VERSION.txt
2011-11-15 23:10:34 -05:00
Daniel Pakuschewski
841c0c2295 Dropped support for wildcard in AuthComponent::allow()
Conflicts:

	lib/Cake/Controller/Component/AuthComponent.php
2011-11-15 23:01:04 -05:00
mark_story
6e4493cc14 Fix ambiguous content types in RequestHandler.
Treat xhtml + html as content types that should trigger no
response/extension setting.  They are different but similar in
that they both generally use the same HTML templates.

Fixes #2257
2011-11-15 22:48:54 -05:00
José Lorenzo Rodríguez
55d4fd3be3 Merge pull request #318 from shama/folder-test
Add test cases to include $exceptions with Folder::chmod()
2011-11-15 09:57:48 -08:00
Ceeram
9fd04307ff adding sort on testresults, to avoid incorrect order returned by MySQL 2011-11-15 17:18:27 +01:00
Kyle Robinson Young
1ebaaf4dd1 Update to assertEquals on Folder tests 2011-11-15 08:18:05 -08:00
Ceeram
37a932b6a7 adding testcase for saving habtm associations with no primary model data set 2011-11-15 16:47:25 +01:00
Renan Gonçalves aka renan.saddam
1db915faec Merge pull request #314 from challet/HttpSocket_handle_redirect
move 'redirect' to request, and allow to use int values as ttl
2011-11-15 03:09:15 -08:00
Kyle Robinson Young
d725869507 Add test cases to include $exceptions with Folder::chmod() 2011-11-14 23:58:58 -08:00