/** * @test */ public function update_will_edit_an_existing_segment() { $repository = $this->getSegmentRepository(); $segment = new Segment(); $segment->setName('Test segment ' . uniqid()); $segment->setCategory('a-test-category'); $segment->setDescription('a test description 123456'); $segment->setCode(rand(0, 999) * rand(0, 999)); $segment->setPrice(10.11); $segment->setMemberId(getenv('MEMBER_ID')); $segment->setActive(true); $repositoryResponse = $repository->add($segment); $this->assertTrue($repositoryResponse->isSuccessful(), $repositoryResponse->getError()->getError()); $segment->setPrice(12.11); $repositoryResponse = $repository->update($segment); $this->assertTrue($repositoryResponse->isSuccessful(), $repositoryResponse->getError()->getError()); $this->assertEquals(12.11, $segment->getPrice()); }