Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Kévin Liagre
    @BboyKeen
    Do you guys have any good and complex examples I can follow ? (by complex I mean classes doing a bit more than just echoing "Hello World" )
    Roel Monnens
    @roelmonnens_twitter
    hey, is it possible to detect return void? something like shouldReturnVoid?
    Jakub Zalas
    @jakzal
    shouldReturnNull()
    Yura Lukashik
    @YuraLukashik
    @roelmonnens_twitter functions without return by default return null value
    there is no void in php
    there is only return typehint in php7 https://wiki.php.net/rfc/void_return_type which doesn’t allow any return statements
    Mohamed Cherif Bouchelaghem
    @cherifGsoul
    Hey all, Im mocking PSR7 interfaces does it mean it is a violation of "Dont mock what you dont own" rule? https://github.com/cherifGsoul/identity-access/blob/master/spec/Infrastructure/Expressive/Http/AuthenticationMiddlewareSpec.php#L32
    Yura Lukashik
    @YuraLukashik
    @cherifGsoul PSR7 is stable enough(it’s even probably more stable than your own interfaces), so I don’t think you should worry about it
    Mohamed Cherif Bouchelaghem
    @cherifGsoul
    @YuraLukashik thank you no doubt for the stability :)
    Christophe Coevoet
    @stof
    just make sure that your mock actually behave exactly like what PSR-7 describes
    this is not easy (especially due to immutability when you need to use the cloning mutators in your code)
    Mohamed Cherif Bouchelaghem
    @cherifGsoul
    @stof Yeah,for now it works, I didnt write integration tests yet to make sure everything is fine
    Roel Monnens
    @roelmonnens_twitter
    hello, does anybody has some guidelines about speeding up our phpspec suite? We are running:
    275 specs
    876 examples (876 passed)
    9672ms
    we run this inside of a vagrant box
    could that be the slow factor?
    Christophe Coevoet
    @stof
    is the code in a vagrant shared folder ? The slow filesystem might be the culprit
    Ciaran McNulty
    @ciaranmcnulty
    That is indeed slow. Why does it need to run inside vagrant?
    Marcin
    @mmp4k
    maybe there is a single test that is slow? did you try run tests one by one?
    SR7
    @mbf-suresh
    guys
    how to run wordpress site in phpspec
    can anyone tell me that how to run custom wordpress sites in phpspec
    Ciaran McNulty
    @ciaranmcnulty
    What do you mean by ‘run in phpspec’?
    SR7
    @mbf-suresh
    phpspec is framework for automation testing
    Igor
    @ishubelko
    @mbf-suresh the person who told you that was kidding you.
    From the index page: "A php toolset to drive emergent
    design by specification." http://www.phpspec.net/en/stable/
    Ciaran McNulty
    @ciaranmcnulty
    I know what phpspec is
    What do you mean by run a site in phpspec?
    Mohamed Cherif Bouchelaghem
    @cherifGsoul
    Hello, the following example doesn't work for me:
    class GenerateOperatorHandlerSpec extends ObjectBehavior
    {
    
        function it_generates_operator(Operators $operators, AuthInfoGenerator $authInfoGenerator)
        {
            //Given operator company named "Mediterranean Float Glass SPA" is not generated
            $companyName = CompanyName::named('Mediterranean Float Glass SPA', '');
            $authInfo = AuthInformation::from('a-username', 'a-password');
            $passiveOperator = PassiveOperator::generate($companyName, $authInfo);
    
            $authInfoGenerator->generateFromCompanyName()->willReturn($authInfo);
    
            // When this operator company is generated
            $command = new GenerateOperatorCommand('Mediterranean Float Glass SPA');
            $this->beConstructedWith($operators, $authInfoGenerator);
            $this->handle($command);
            $operators->add($passiveOperator)->shouldHaveBeenCalled();
        }
    }
     no calls have been made that match:
            Double\Operators\P2->add(exact(NetBeOpen\Seciac\Model\Operator\PassiveOperator:0000000004b18c4b0000000003a381d0 Object (
              'companyName' => NetBeOpen\Seciac\Model\Operator\CompanyName:0000000004b18cbe0000000003a381d0 Object (
                  'name' => 'Mediterranean Float Glass SPA'
                  'shortName' => ''
              )
              'authInfo' => NetBeOpen\Seciac\Model\Operator\AuthInformation:0000000004b18cbd0000000003a381d0 Object (
                  'username' => 'a-username'
                  'password' => 'a-password'
              )
          )))
          but expected at least one.
          Recorded `add(...)` calls:
            - add(NetBeOpen\Seciac\Model\Operator\PassiveOperator:0000000004b18c7d0000000003a381d0 Object (
              'companyName' => NetBeOpen\Seciac\Model\Operator\CompanyName:0000000004b18c720000000003a381d0 Object (
                  'name' => 'Mediterranean Float Glass SPA'
                  'shortName' => ''
              )
              'authInfo' => NetBeOpen\Seciac\Model\Operator\AuthInformation:0000000004b18cbd0000000003a381d0 Object (
                  'username' => 'a-username'
                  'password' => 'a-password'
              )
          )) @ src/Service/GenerateOperatorHandler.php:30
    In my code add method is invoked but phpspec said is not
    Mohamed Cherif Bouchelaghem
    @cherifGsoul
    I fixed it the following way:
    function it_generates_operator(Operators $operators, AuthInfoGenerator $authInfoGenerator)
        {
            //Given operator company named "Mediterranean Float Glass SPA" is not generated
            $authInfo = AuthInformation::from('a-username', 'a-password');
    
            $authInfoGenerator->generateFromCompanyName(Argument::type(CompanyName::class))->willReturn($authInfo);
    
            // When this operator company is generated
            $command = new GenerateOperatorCommand('Mediterranean Float Glass SPA');
            $this->beConstructedWith($operators, $authInfoGenerator);
            $this->handle($command);
            $operators->add(Argument::type(PassiveOperator::class))->shouldHaveBeenCalled();
        }