for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare( strict_types = 1 );
namespace WMDE\Fundraising\Store\Tests;
use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\TestCase;
use WMDE\Fundraising\Entities\AddressChange;
use WMDE\Fundraising\Entities\MembershipApplication;
/**
* @covers WMDE\Fundraising\Entities\AddressChange
*/
class MembershipAddressChangeTest extends TestCase {
* @var EntityManager
private $entityManager;
public function setUp(): void {
$this->entityManager = TestEnvironment::newDefault()->getFactory()->getEntityManager();
}
public function testWhenMembershipApplicationIsCreated_addressChangeUuidIsStored(): void {
$this->markTestIncomplete( 'Broken for now, will fix in next commit' );
$application = new MembershipApplication();
$application->setAddressChange( AddressChange::newMembershipAddressChange( AddressChange::ADDRESS_TYPE_PERSON, 1 ) );
setAddressChange()
WMDE\Fundraising\Entities\MembershipApplication
setAddress()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
$oldId = $application->getAddressChange()->getCurrentIdentifier();
getAddressChange()
getAddress()
$this->entityManager->persist( $application );
$this->entityManager->flush();
/** @var MembershipApplication $persistedApplication */
$persistedApplication = $this->entityManager->find( MembershipApplication::class, 1 );
$this->assertSame(
$oldId,
$persistedApplication->getAddressChange()->getCurrentIdentifier()
);
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.