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

T13655 DI::getServices unit tests #14176

Closed
wants to merge 6 commits into from

Conversation

emiliodeg
Copy link
Contributor

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Small description of change:
I just added DI::getServices unit tests
Thanks

@emiliodeg
Copy link
Contributor Author

As I thought there is a problem with zephir and unset on arrays

Di::remove() doesn't work as expected

@emiliodeg
Copy link
Contributor Author

Here the Zephir bug zephir-lang/zephir#1259

@phalcon phalcon deleted a comment from emiliodeg Jun 11, 2019
@sergeyklay sergeyklay self-assigned this Jun 16, 2019
@sergeyklay sergeyklay added the wip Work In Progress label Jun 16, 2019
@sergeyklay
Copy link
Contributor

@emiliodeg Try again after #14191

@sergeyklay sergeyklay removed the wip Work In Progress label Jun 20, 2019
@sergeyklay sergeyklay removed their assignment Jun 20, 2019
# Conflicts:
#	tests/unit/Di/GetServicesCest.php
@sergeyklay
Copy link
Contributor

Declaration of:

Phalcon\Validation\ValidatorComposite::validate(Phalcon\Validation\Validation $validation, $field): bool

must be compatible with

Phalcon\Validation\Validator::validate(Phalcon\Validation $validation, $field): bool 

Declaration of

Phalcon\Validation\Validator\File::getValidators()

must be compatible with

Phalcon\Validation\ValidatorCompositeInterface::getValidators(): array

Declaration of:

Phalcon\Validation\Validator\StringLength::getValidators()

must be compatible with

Phalcon\Validation\ValidatorCompositeInterface::getValidators(): array 

and so on

@niden
Copy link
Sponsor Member

niden commented Jun 21, 2019

@emiliodeg can you rebase this please?

@emiliodeg
Copy link
Contributor Author

Yes I'm working on it

@emiliodeg
Copy link
Contributor Author

Well the unset bug is still there

@sergeyklay
Copy link
Contributor

I did'n see any segfault. Are you sure about unset bug?

@emiliodeg
Copy link
Contributor Author

I've been making some tests but I still getting problems

namespace Phalcon;

class Test {

    public function __construct()
    {
        var a, key;
        array b = [];

        // a like a var
        let a["key"] = 1234;
        var_dump(a, count(a)); // get UNKNOWN and 1

        unset a["key"];
        var_dump(a, count(a));  // get UNKNOWN and 1 <<< must be 0

        let key = "other";
        let a[key] = "bar";
        var_dump(a, count(a)); // get UNKNOWN and 1

        unset a[key];
        var_dump(a, count(a));  // get UNKNOWN and 1 <<< must be 0

        // b like an array
        var_dump(b, count(b)); // get UNKNOWN and 1 <<< must be 0

        let b["key"] = 1234;
        var_dump(b, count(b));// get UNKNOWN and 1

        unset b["key"];
        var_dump(b, count(b));// get UNKNOWN and 1 <<< must be 0

        let key = "other";
        let b[key] = "bar";
        var_dump(b, count(b));// get UNKNOWN and 1 <<< must be 0

        unset b[key];
        var_dump(b, count(b)); // get UNKNOWN and 1 <<< must be 0
    }
}

I don't know maybe is a problem with count()

@sergeyklay
Copy link
Contributor

@emiliodeg Could you please open an issue at Zephir with simple steps to reproduce (not a whole framework)?

@ruudboon
Copy link
Member

ruudboon commented Aug 3, 2019

@emiliodeg Did you already tested this with the latest Zephir?

@emiliodeg
Copy link
Contributor Author

I'm so sorry but I didn't have time yet. I'll try this weekend

@ruudboon
Copy link
Member

@emiliodeg closing this pull in favour of #14396. I included your tests, fix will be in soon. Thnx!

@ruudboon ruudboon closed this Sep 21, 2019
@niden niden added the 4.0 label Dec 2, 2019
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.

4 participants