4 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceTableDataProviderFactory.php';
5 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceTableDatabaseDataProvider.php';
6 require_once
'Services/TermsOfService/test/ilTermsOfServiceBaseTest.php';
32 $factory->setDatabaseAdapter($this->getMockBuilder(
'ilDBInterface')->getMock());
35 $this->assertInstanceOf(
'ilTermsOfServiceAcceptanceHistoryProvider',
$provider);
36 $this->assertInstanceOf(
'ilTermsOfServiceTableDatabaseDataProvider',
$provider);
37 $this->assertInstanceOf(
'ilTermsOfServiceTableDataProvider',
$provider);
47 $database = $this->getMockBuilder(
'ilDBInterface')->getMock();
48 $result = $this->getMockBuilder(
'ilDBStatement')->getMock();
51 $factory->setDatabaseAdapter($database);
54 $database->expects($this->exactly(2))->method(
'query')->with($this->stringContains(
'SELECT'))->will($this->returnValue(
$result));
55 $database->expects($this->exactly(4))->method(
'fetchAssoc')->will($this->onConsecutiveCalls(
array(
'phpunit'),
array(
'phpunit'),
array(),
array(
'cnt' => 2)));
56 $database->expects($this->any())->method(
'like')->with(
57 $this->isType(
'string'),
58 $this->isType(
'string'),
59 $this->isType(
'string')
60 )->will($this->returnArgument(2));
61 $database->expects($this->any())->method(
'quote')->with($this->anything(), $this->isType(
'string'))->will($this->returnArgument(0));
77 $this->assertArrayHasKey(
'items',
$data);
78 $this->assertArrayHasKey(
'cnt',
$data);
79 $this->assertCount(2,
$data[
'items']);
80 $this->assertEquals(2,
$data[
'cnt']);
88 $database = $this->getMockBuilder(
'ilDBInterface')->getMock();
90 $factory->setDatabaseAdapter($database);
95 $this->fail(
'An expected exception has not been raised.');
101 $this->fail(
'An expected exception has not been raised.');
107 $this->fail(
'An expected exception has not been raised.');
113 $this->fail(
'An expected exception has not been raised.');
119 $this->fail(
'An expected exception has not been raised.');
const CONTEXT_ACCEPTANCE_HISTORY
testHistoryProviderCanBeCreatedByFactory()
Create styles array
The data for the language used.
testRetrievingListThrowsExceptionsWhenInvalidArgumentsArePassed()
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.