TestCase

Helper methods for building commonly used mock objects for testing. The idea is to first set the mock objects to variables and then set their expectations according to the specific test case.
extends PHPUnit_Framework_TestCase

Known subclasses

Omeka\Test\DbTestCase
Methods Summary
public
# getServiceManager( array $services = array ( ) )
Get a mock Zend\ServiceManager\ServiceManager (ServiceLocator) object. Pass mock service objects that should be accessible via the mocked ServiceManager::get().
public
# getEntityManager( )
Get a mock Doctrine\ORM\EntityManager object.
public
public
# getQueryBuilder( )
Get a mock Doctrine\ORM\QueryBuilder object.
public
# getQuery( array $methods = array ( ) )
Get a mock Doctrine\ORM\Query object. Doctrine\ORM\Query cannot be mocked because it is declared "final". Instead, mock stdClass and assign the requisite methods.
Methods inherited from PHPUnit_Framework_TestCase
__construct(), toString(), count(), getAnnotations(), getName(), getSize(), getActualOutput(), hasOutput(), expectOutputRegex(), expectOutputString(), hasPerformedExpectationsOnOutput(), hasExpectationOnOutput(), getExpectedException(), setExpectedException(), setExpectedExceptionRegExp(), setExpectedExceptionFromAnnotation(), setUseErrorHandler(), setUseErrorHandlerFromAnnotation(), checkRequirements(), getStatus(), getStatusMessage(), hasFailed(), run(), runBare(), runTest(), verifyMockObjects(), setName(), setDependencies(), hasDependencies(), setDependencyInput(), setDisallowChangesToGlobalState(), setBackupGlobals(), setBackupStaticAttributes(), setRunTestInSeparateProcess(), setPreserveGlobalState(), setInIsolation(), isInIsolation(), getResult(), setResult(), setOutputCallback(), getTestResultObject(), setTestResultObject(), iniSet(), setLocale(), getMock(), getMockBuilder(), getMockClass(), getMockForAbstractClass(), getMockFromWsdl(), getMockForTrait(), getObjectForTrait(), prophesize(), addToAssertionCount(), getNumAssertions(), any(), never(), atLeast(), atLeastOnce(), once(), exactly(), atMost(), at(), returnValue(), returnValueMap(), returnArgument(), returnCallback(), returnSelf(), throwException(), onConsecutiveCalls(), getDataSetAsString(), createResult(), handleDependencies(), setUpBeforeClass(), setUp(), assertPreConditions(), assertPostConditions(), tearDown(), tearDownAfterClass(), onNotSuccessfulTest(), prepareTemplate(), getMockObjectGenerator()
Methods inherited from PHPUnit_Framework_Assert
assertArrayHasKey(), assertArraySubset(), assertArrayNotHasKey(), assertContains(), assertAttributeContains(), assertNotContains(), assertAttributeNotContains(), assertContainsOnly(), assertContainsOnlyInstancesOf(), assertAttributeContainsOnly(), assertNotContainsOnly(), assertAttributeNotContainsOnly(), assertCount(), assertAttributeCount(), assertNotCount(), assertAttributeNotCount(), assertEquals(), assertAttributeEquals(), assertNotEquals(), assertAttributeNotEquals(), assertEmpty(), assertAttributeEmpty(), assertNotEmpty(), assertAttributeNotEmpty(), assertGreaterThan(), assertAttributeGreaterThan(), assertGreaterThanOrEqual(), assertAttributeGreaterThanOrEqual(), assertLessThan(), assertAttributeLessThan(), assertLessThanOrEqual(), assertAttributeLessThanOrEqual(), assertFileEquals(), assertFileNotEquals(), assertStringEqualsFile(), assertStringNotEqualsFile(), assertFileExists(), assertFileNotExists(), assertTrue(), assertNotTrue(), assertFalse(), assertNotFalse(), assertNotNull(), assertNull(), assertClassHasAttribute(), assertClassNotHasAttribute(), assertClassHasStaticAttribute(), assertClassNotHasStaticAttribute(), assertObjectHasAttribute(), assertObjectNotHasAttribute(), assertSame(), assertAttributeSame(), assertNotSame(), assertAttributeNotSame(), assertInstanceOf(), assertAttributeInstanceOf(), assertNotInstanceOf(), assertAttributeNotInstanceOf(), assertInternalType(), assertAttributeInternalType(), assertNotInternalType(), assertAttributeNotInternalType(), assertRegExp(), assertNotRegExp(), assertSameSize(), assertNotSameSize(), assertStringMatchesFormat(), assertStringNotMatchesFormat(), assertStringMatchesFormatFile(), assertStringNotMatchesFormatFile(), assertStringStartsWith(), assertStringStartsNotWith(), assertStringEndsWith(), assertStringEndsNotWith(), assertXmlFileEqualsXmlFile(), assertXmlFileNotEqualsXmlFile(), assertXmlStringEqualsXmlFile(), assertXmlStringNotEqualsXmlFile(), assertXmlStringEqualsXmlString(), assertXmlStringNotEqualsXmlString(), assertEqualXMLStructure(), assertSelectCount(), assertSelectRegExp(), assertSelectEquals(), assertTag(), assertNotTag(), assertThat(), assertJson(), assertJsonStringEqualsJsonString(), assertJsonStringNotEqualsJsonString(), assertJsonStringEqualsJsonFile(), assertJsonStringNotEqualsJsonFile(), assertJsonFileNotEqualsJsonFile(), assertJsonFileEqualsJsonFile(), logicalAnd(), logicalOr(), logicalNot(), logicalXor(), anything(), isTrue(), callback(), isFalse(), isJson(), isNull(), attribute(), contains(), containsOnly(), containsOnlyInstancesOf(), arrayHasKey(), equalTo(), attributeEqualTo(), isEmpty(), fileExists(), greaterThan(), greaterThanOrEqual(), classHasAttribute(), classHasStaticAttribute(), objectHasAttribute(), identicalTo(), isInstanceOf(), isType(), lessThan(), lessThanOrEqual(), matchesRegularExpression(), matches(), stringStartsWith(), stringContains(), stringEndsWith(), countOf(), fail(), readAttribute(), getStaticAttribute(), getObjectAttribute(), markTestIncomplete(), markTestSkipped(), getCount(), resetCount()
Properties inherited from PHPUnit_Framework_TestCase
$backupGlobals, $backupGlobalsBlacklist, $backupStaticAttributes, $backupStaticAttributesBlacklist, $runTestInSeparateProcess, $preserveGlobalState