Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests stubs for ViewSimple #1560

Merged
merged 10 commits into from
Nov 26, 2013
Merged

Conversation

pgasiorowski
Copy link
Contributor

This PR is for testing Phalcon\Mvc\View\Simple
Could you pls check if I'm doing caching correctly?

Only tested on Phalcon 1.3.0 atm, will do 2.0.0 soon

@pgasiorowski
Copy link
Contributor Author

Is everything allright with travis?
Im not sure why it is failing on PHP5.3.3 and 5.5

@phalcon
Copy link
Collaborator

phalcon commented Nov 18, 2013

A segfault is happening:

Core was generated by `/home/travis/.phpenv/versions/5.3.3/bin/php ./unit-tests/ci/phpunit.php --debug'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000818c4e in gc_zval_possible_root (zv=0x5ba3c70, 
    tsrm_ls=0x2475310) at /tmp/php-build/source/5.3.3/Zend/zend_gc.c:143
143 /tmp/php-build/source/5.3.3/Zend/zend_gc.c: No such file or directory.
(gdb) (gdb) #0  0x0000000000818c4e in gc_zval_possible_root (zv=0x5ba3c70, tsrm_ls=0x2475310) at /tmp/php-build/source/5.3.3/Zend/zend_gc.c:143
No locals.
#1  0x0000000000806d48 in zend_hash_destroy (ht=0x5b72b90) at /tmp/php-build/source/5.3.3/Zend/zend_hash.c:526
        p = 0x5bb34d0
        q = 0x5bb3468
#2  0x000000000081a0d9 in zend_object_std_dtor (object=0x5baf648, tsrm_ls=<optimized out>) at /tmp/php-build/source/5.3.3/Zend/zend_objects.c:45
No locals.
#3  0x000000000081a0f9 in zend_objects_free_object_storage (object=0x5baf648, tsrm_ls=<optimized out>) at /tmp/php-build/source/5.3.3/Zend/zend_objects.c:128
No locals.
#4  0x000000000081e4c5 in zend_objects_store_del_ref_by_handle_ex (handle=2669, handlers=<optimized out>, tsrm_ls=0x2475310) at /tmp/php-build/source/5.3.3/Zend/zend_objects_API.c:220
        __orig_bailout = 0x7fffa356b2b0
        __bailout = {{__jmpbuf = {96107536, -4550680150059536115, 0, 0, 0, 0, 4550885913217446157, -4550683949451726579}, __mask_was_saved = 0, __saved_mask = {__val = {13896063923650015501, 0, 0, 0, 0, 4550885913192280333, 13896060124257825037, 0, 7949371, 96050088, 8222102, 96050064, 7949371, 0, 7949371, 96050024}}}}
        obj = 0x5713778
        failure = <optimized out>
#5  0x000000000081e4fe in zend_objects_store_del_ref (zobject=0x5ba7c10, tsrm_ls=0x2475310) at /tmp/php-build/source/5.3.3/Zend/zend_objects_API.c:172

@ghost
Copy link

ghost commented Nov 19, 2013

This looks like a bug in View\Simple.

@ghost
Copy link

ghost commented Nov 19, 2013

==4348== Invalid read of size 8
==4348==    at 0x9E53FD: zend_mm_check_ptr (zend_alloc.c:1374)
==4348==    by 0x9E735F: _zend_mm_free_int (zend_alloc.c:2068)
==4348==    by 0x9E8A90: _efree (zend_alloc.c:2440)
==4348==    by 0xA1DCB8: destroy_op_array (zend_opcode.c:408)
==4348==    by 0xA1CC3A: destroy_zend_function (zend_opcode.c:116)
==4348==    by 0xA1CC71: zend_function_dtor (zend_opcode.c:128)
==4348==    by 0xA42280: zend_hash_destroy (zend_hash.c:560)
==4348==    by 0xA1D6A9: destroy_zend_class (zend_opcode.c:300)
==4348==    by 0xA4266C: zend_hash_apply_deleter (zend_hash.c:650)
==4348==    by 0xA42D16: zend_hash_reverse_apply (zend_hash.c:804)
==4348==    by 0xA153D4: shutdown_executor (zend_execute_API.c:303)
==4348==    by 0xA2CC48: zend_deactivate (zend.c:939)
==4348==  Address 0xffffffc7 is not stack'd, malloc'd or (recently) free'd
==4348==
==4348==
==4348== Process terminating with default action of signal 11 (SIGSEGV)


public function testMissingView()
{
$this->setExpectedException('Exception');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPUnit 3.6.10 throws an exception here:

InvalidArgumentException: You must not expect the generic exception class.

The correct syntax will be

$this->setExpectedException('Phalcon\Mvc\View\Exception');

@ghost
Copy link

ghost commented Nov 19, 2013

$(phpenv which php) /usr/bin/phpunit -c unit-tests/phpunit.xml --filter View
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /home/vladimir/workspace/cphalcon/unit-tests/phpunit.xml

...........SSSSSS........Hey, this is a partial, also FooBar.

Time: 21 seconds, Memory: 30.25Mb

OK, but incomplete or skipped tests!
Tests: 26, Assertions: 116, Skipped: 6.

The test script outputs Hey, this is a partial, also FooBar, is this the expected behavior?

@pgasiorowski
Copy link
Contributor Author

Yes, output Hey, this is a partial, also FooBar is expected in that case. I could wrap it whit ob_start if it's affecting the test

@phalcon
Copy link
Collaborator

phalcon commented Nov 25, 2013

Could you please merge this PR against current 1.3.0?

phalcon pushed a commit that referenced this pull request Nov 26, 2013
@phalcon phalcon merged commit 9388b10 into phalcon:1.3.0 Nov 26, 2013
@pgasiorowski pgasiorowski deleted the 1.3.0-tests-viewsimple branch November 26, 2013 17:51
@pgasiorowski pgasiorowski restored the 1.3.0-tests-viewsimple branch November 26, 2013 17:51
@pgasiorowski
Copy link
Contributor Author

I've only heard about random segfaults on travis with PHP but first time really see it happening.

@ghost
Copy link

ghost commented Nov 28, 2013

Segfault is addressed in #1607

@pgasiorowski pgasiorowski deleted the 1.3.0-tests-viewsimple branch November 28, 2013 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants