Completed
Pull Request — master (#66)
by Leszek
02:33
created

testNewMembershipApplicationCanBeInserted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace WMDE\Fundraising\Store\Tests;
4
5
use WMDE\Fundraising\Entities\MembershipApplication;
6
7
class MembershipApplicationInsertionTest extends \PHPUnit_Framework_TestCase {
8
9
	public function testNewMembershipApplicationCanBeInserted() {
10
		$entityManager = TestEnvironment::newDefault()->getFactory()->getEntityManager();
11
		$entityManager->persist( new MembershipApplication() );
12
		$entityManager->flush();
13
		$count = $entityManager->createQueryBuilder()
14
			->select( 'COUNT(r.id)' )
15
			->from( MembershipApplication::class, 'r' )
16
			->getQuery()
17
			->getSingleScalarResult();
18
		$this->assertEquals( 1, $count ); // Can't use assertSame because a string is returned
19
	}
20
}
21