Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Optimise Model::key() and fix some issues #582

Closed
wants to merge 257 commits into
from

Conversation

Projects
None yet
Contributor

jails commented Jul 15, 2012

Fix :

  • with multiples keys return null if one of them miss in the datas
  • Model::key(array()) return null instead of returning the id.

Optimisation :

  • ::to('array') is no more the default behavior for looking for key in entities
  • removing the use of method_exists()

phuff and others added some commits May 8, 2012

@phuff phuff Add quotes so that directories with spaces will still work when using…
… li3 on the command line.
b44e205
@adamroyle @davidpersson adamroyle + davidpersson Fix Unit::_cleanUp() so "app/resources/tmp/tests/empty" file is not d…
…eleted on Windows.

Signed-off-by: David Persson <davidpersson@gmx.de>
c7b08dd
@davidpersson davidpersson Updating docblock for `Unit::_cleanUp()`.
Moving inline documetation into method docblock.
Documenting Windows behavior.
f529905
@davidpersson davidpersson Fixing too long line. 5a92d99
@davidpersson davidpersson Synchronizing defaults in test `Report` and `Dispatcher`.
Changing default for `'reporter'` in `Dispatcher`.
Adding missing options documentation.
dc68018
@davidpersson davidpersson Changing default command header output style.
Lines will now by default be the same width as the provided text.
Updating dockblock.
Adding example to docblock.
8564937
@davidpersson davidpersson Initial implementation of console test progress. 952d9a5
@davidpersson davidpersson Changing return from `_runTestMethod()`.
Removing returning of `$passed` as this was always `null`, because the
inner function was not returning anything.

Always returning `$this->_results` as already done in the upper body of
the method in some cases.
6e7e33a
@davidpersson davidpersson Formatting test profiler console text output. 49b2ef1
@davidpersson davidpersson Correcting indentation level in profiler console output. e712701
@davidpersson davidpersson Removing configuration output of test command. cb66862
@davidpersson davidpersson Fixing usage of `$this`. 2635f93
@davidpersson davidpersson Making parameter in test runner optional. 65eddeb
@davidpersson davidpersson Refitting test reporter as progress reporter.
As in the orginal concept as of `Unit::_result()`.
This will allow to progress print after each assertion.
266559b
@davidpersson davidpersson Removing progress filter option. 0408339
@davidpersson davidpersson Explain filters option for help command. de39498
@davidpersson davidpersson Updating test command to use new reporter.
Dropping usage of progress filter option.
Adding verbose option and progress print mode.
17b4811
@davidpersson davidpersson Dropping usage of reporter in test controller. 65e0e81
@davidpersson davidpersson Adding exception to the expected types. b4e0099
@davidpersson davidpersson Updating report unit tests for new reporter. a5c014f
@davidpersson davidpersson Updating help command test for new test command signature. b61f594
@davidpersson davidpersson Skips do not have class or method info. 138e8e3
@davidpersson davidpersson Use verbose mode and profiler filter during CI. b8718bc
@davidpersson davidpersson Adding line number in verbose test command output. 553eac5
@davidpersson davidpersson Fixing printf template for possible strings. feec693
@davidpersson davidpersson Use mock in `UnitTest` do not interfer with normal test reporting.
Formatting tests.
Adding accessors for protected methods/properties in mock.
(Re)moving any helper methods used in test defined in test.
Refactoring test with precondition on expecting exceptions.
Removing repetitive assertions on backtrace data.
Adding new test for testing backtracing.
630b572
@davidpersson davidpersson Changing test to use uncomplicated txt format.
Updating expectation for changes to mock.
5a10e14
@davidpersson davidpersson Removing information about integration testing from `Unit` docblock.
There is now an `Integration` class.
5e0f613
@davidpersson davidpersson Revert "Changing return from `_runTestMethod()`."
This reverts commit 480a74f61eab178e95333e26f540d90f1945a3f8.

This change was interfering with the cancellation of integration test
runs thus causing existing tests to fail.
90cb2ab
@davidpersson davidpersson Relaxing expectation on coverage in `FilterTest`; formatting. 6d81ba6
@davidpersson davidpersson Updating docblock formatting f29660f
@davidpersson davidpersson Formatting. 3524c2d
@davidpersson davidpersson Removing unused assingment. 1608746
@davidpersson davidpersson Use non-alias version of the function for DNS resolution.
The aliased version causes timeouts ("hangs") in certain environments.
This was specifically seen on Travis CI workers. No explanation why this
behavior occurs can be given at this point.
1a382af
@davidpersson davidpersson Close file descriptor after opening. ad83f3a
@davidpersson davidpersson Revert "Use non-alias version of the function for DNS resolution."
This reverts commit 05b42ec5c1b2da642d96d057b56c99de42675cc4.

Conflicts:

	test/Unit.php
0ab31fd
@davidpersson davidpersson Change `Unit::_hasNetwork()` to check for A record.
Checking for ANY causes timeouts in certain environments. Especially
Travis CI worker appear to hang on the function call when using ANY.
3d9fc63
@davidpersson davidpersson Use non verbose mode for test output on travis. 9940ecb
@davidpersson davidpersson Better isolating integration test.
Prevent leaking of modifications to transliteration rules.
16e010e
@davidpersson davidpersson Removing subheadings from test command. 2b60429
@davidpersson davidpersson Reordering styles in console response. af55801
@davidpersson davidpersson Removing explicit return of `null`. 907943d
@davidpersson davidpersson Normalizing test paths trimming trailing slash. a73f55a
@davidpersson davidpersson Formatting error messages in test command. fbab6e4
@davidpersson davidpersson Updating path mapping in test command to allow non-test paths.
Expanding docblock with examples.
Updating dockblock explanation to better match functionality.
dd3b3c6
@davidpersson davidpersson Test command can now find and run test for a given file.
Directories aren't yet supported.
Updating docblock with example.
2d52c6a
@davidpersson davidpersson Removing functionless `nl()` call. 5d8113e
@davidpersson davidpersson Adding general OK/FAIL to end of test run. 7b7eebc
@davidpersson davidpersson Formatting. b31ea5f
@davidpersson davidpersson Fixing test failing due to latest changes in test command. e9f0952
@davidpersson davidpersson Differ in exit codes. 4e2771f
@davidpersson davidpersson Introducting plain mode for test command.
Formatting output.
52fc3a6
@davidpersson davidpersson Better filter files to try to map.
Removing debug code.
6e347f6
@davidpersson davidpersson Updating help command test for changed signature. 407f2c3
@davidpersson davidpersson Updating report test for moved template. 209b6c9
@davidpersson davidpersson Force newline on assert message. 9bbee96
@davidpersson davidpersson Typo. 198614a
@davidpersson davidpersson Adding mistakenly removed newline back. 40cdef2
@davidpersson davidpersson Disabling memcache extension installation on CI.
This forces tests to skip. Although the CI environment was featuring a
running Memcached it wasn't advertised and sometimes not working as
expected, causing tests to fail.

This patch can be reverted when the CI environment starts to advertise a
Memcached or such a daemon can be installed and started manually.
84c3cba
@davidpersson @nateabele davidpersson + nateabele Adding `Multibyte` class for working with UTF-8 encoded strings.
Adding tests.
Adding stress test file, creating `tests/resources`.
Adding adapters for interfacing with:
- `ext/iconv`
- `ext/intl`
- `ext/mbstring`
b7f2e08

Not trying to be a hater ... but it's been a month since the last commit? Eeek.

Owner

nateabele replied Sep 6, 2012

@justinjenkins Yeah, it's called becoming a parent. ;-) Also: https://github.com/UnionOfRAD/lithium/branches

Ah, well being a father is a bit more of a commit(ment) ... like I said, not trying to be a hater ... really appreciate all your hard work on li3, use it everyday.

Owner

nateabele replied Sep 6, 2012

No worries. I actually have a bunch of work stashed locally that I've been meaning to clean up and push for the next release. Taking some time off next week to finalize that stuff, so look for a new version soon-ish.

rapzo and others added some commits Sep 12, 2012

@rapzo rapzo Fixed the Command::nl() docblock. Method doesn't print to the output, it
builds a string and returns it.
d8f9742
@nateabele nateabele Implementing host mapping in `\core\Environment::is()`. 7b422f4
@nateabele nateabele Merge pull request #638 from rapzo/dev
Fixed the Command::nl() docblock. Method doesn't print to the output,
471bdd6
@nateabele nateabele Merge branch 'master' of git://github.com/pixelcog/lithium into pixelcog 51d1770
@nateabele nateabele Merge branch 'master' of git://github.com/v-v-vishnevskiy/lithium int…
…o v-v-vishnevskiy
ebcbb06
@nateabele nateabele Merge branch 'cli-improvements' of git://github.com/dshafik/lithium i…
…nto dshafik
49f5692
@nateabele nateabele Ensuring full docblocks are presented in console `Help` command for b…
…oth classes and methods. Misc. code cleanup.
c8545ff
@nateabele nateabele Adding accessor patterns to `Libraries::get()`. b27096c
@ppadron ppadron Implementing return handlers in net\http\Service and adding support f…
…or $path and $data to HEAD requests. Closes #640.
1ccc1b1
@nateabele nateabele Merge pull request #641 from ppadron/dev
Return handlers in net\http\Service and support for $path and $data in HEAD requests
5f3c105
@mehlah @mehlah mehlah + mehlah Update phar-packaged app layout. d593121
@nateabele nateabele Merge pull request #646 from mehlah/lithium-app-phar
Update phar-packaged app layout.
ddc1dc1
@ericcholis @nateabele ericcholis + nateabele Extend Request.php to include Http Proxy support
Extended Request.php to allow for configurable Http Proxy support when using 'context' format. See http://www.php.net/manual/en/function.stream-context-create.php#92586
7052580
@nateabele nateabele Fixing up proxy support implementation for `\net\http\Request`, and a…
…dding test cases.
d42184c
@ppadron ppadron Data for PATCH requests in net\http\Service should be encoded in the …
…request body. Fixes #647.
2576ec8
@nateabele nateabele Merge pull request #648 from ppadron/dev
Data for PATCH requests in net\http\Service should be encoded in the request body. Fixes #647.
b5e4c87
@ppadron ppadron Adding net\http\Service::patch() method. d0491b6
@ppadron ppadron Setting correct Content-Type for PATCH requests in net\http\Request. c49de93
@nateabele nateabele Merge pull request #649 from ppadron/dev
Services::patch() method + Content-Type fix in net\http\Request for PATCH
d35f656
@yitznewton yitznewton From Controller, look for view in own library
To this point, li3 defaults to app/views. With this change, li3 looks by
default in libraries/foo/views/, where foo is the library containing the
Controller.

remove newlines at EOF
a29012a
@nateabele nateabele Merge pull request #650 from yitznewton/dev
From Controller, look for view in own library
1d6fae0
@nateabele nateabele Supporting additional HTTP response codes, and correctly distinguishi…
…ng between 406 and 415, `Media::handlers()` is public now.
becc3b6
@nateabele nateabele Allowing `Environment::set()` to assign to multiple environments. 73a07d8
@d1rk d1rk allow auth adapters to return a single value instead of arrays 2110acd
@d1rk d1rk allow dispatching of unknown methods to redis connection object 5ffd4da
@nateabele nateabele Merge pull request #655 from d1rk/auth-array-scalar
allow auth adapters to return a single value instead of arrays
28c5ee3
@nateabele nateabele Merge pull request #656 from d1rk/redis-method-dispatch
allow dispatching of unknown methods to redis connection object
06fc157
@nateabele Dan Fellars + nateabele added support for PUT to add body in Curl with tests afb3e15
@rapzo rapzo Fixed typo: Set::insert() to String::insert() in String::clean()
docblock.
7e68c17
@nateabele nateabele Merge pull request #659 from rapzo/dev
Fixed typo
9432658
@nateabele @gwoo nateabele + gwoo First pass at disambiguating request/response content type. WARNING: …
…BC break - going forward, usage of the `$type` instance property should be replaced with the `type()` method.
854171d
@gwoo gwoo WARNING: BC break. Use `type` method. to properly set Content-Type on…
… all Request/Responses.

Message bodies automatically encoded/decoded for convenience.
0121ca5
@gwoo gwoo Fixing up some more failing tests related to `type()` changes. 13a1e45
@gwoo gwoo Making Service delete return the empty body again. 62ad34d
@gwoo gwoo Adding test for encoded messages in \action\Response.
Reorganizing some tests to make it clearer what is tested.
4b33020
@gwoo gwoo Merge pull request #662 from UnionOfRAD/request-response
WARNING: BC break. Request and Response refactor usage of type()
2c0485c
@nateabele nateabele Ensuring proper casing for Location header in `\action\Response::_ini…
…t()`.
8306219
@nateabele nateabele Ensuring request method is not improperly overwritten in `\action\Req…
…uest`.
5e0ad63

There is small problem, that now controller tries to pull the layout also from library. Before this change I was constantly told, that this feature is unneeded. Now it's implemented into core.

Member

d1rk replied Oct 11, 2012

It should look for the view in the library, then for a layout in the library, but if it does not find one, take the one from app.

Is this (and the next 2 asserts) not hardcoded with the path that the library would be in, if it is tested stand-alone?

All tests pass if I run them from the cli on just the library. If I run the tests through the web interface, in an app context, testCustomAssetUrls() fails on all three asserts.

e.g.

expected: 'http://static.cdn.com/lithium/js/foo.js'
result: 'http://static.cdn.com/app/js/foo.js'

Owner

nateabele replied Nov 6, 2012

@davidmturner Ah, good call. Yes, the test assumes it's being run from the docroot, so we'll have to control for that in the test. Can you do me a favor and open an issue so we don't lose track of it?

jails and others added some commits Nov 8, 2012

Member

d1rk commented Nov 19, 2012

Any reasons why this is not merged?

Owner

nateabele commented Nov 19, 2012

@d1rk Because it includes deeply-nested control structures, and breaks the per-method cyclomatic complexity limit.

Member

d1rk commented Nov 19, 2012

@nateabele thanks for the info, good to know.

@jails jails closed this Nov 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment