18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
30 protected function setUp()
32 $this->subject = $this->getMockBuilder(DatabaseParentPageRow::class)
33 ->setMethods([
'getDatabaseRow'])
43 'tableName' =>
'tt_content',
52 $this->subject->expects($this->at(0))
53 ->method(
'getDatabaseRow')
54 ->with($input[
'tableName'], 10)
55 ->willReturn([
'pid' => 123]);
57 $this->subject->expects($this->at(1))
58 ->method(
'getDatabaseRow')
60 ->willReturn($parentPageRow);
62 $result = $this->subject->addData($input);
64 $this->assertSame($parentPageRow, $result[
'parentPageRow']);
73 'tableName' =>
'tt_content',
85 $this->subject->expects($this->at(0))
86 ->method(
'getDatabaseRow')
87 ->with($input[
'tableName'], 10)
88 ->willReturn($neigborRow);
90 $this->subject->expects($this->at(1))
91 ->method(
'getDatabaseRow')
93 ->willReturn($parentPageRow);
95 $result = $this->subject->addData($input);
97 $this->assertSame($neigborRow, $result[
'neighborRow']);
106 'tableName' =>
'tt_content',
111 $this->subject->expects($this->once())
112 ->method(
'getDatabaseRow')
113 ->with($input[
'tableName'], 10)
114 ->willReturn([
'pid' => 0]);
116 $result = $this->subject->addData($input);
118 $this->assertNull($result[
'parentPageRow']);
127 'tableName' =>
'tt_content',
136 $this->subject->expects($this->once())
137 ->method(
'getDatabaseRow')
139 ->willReturn($parentPageRow);
141 $result = $this->subject->addData($input);
143 $this->assertSame($parentPageRow, $result[
'parentPageRow']);
152 'tableName' =>
'tt_content',
164 $this->subject->expects($this->once())
165 ->method(
'getDatabaseRow')
167 ->willReturn($parentPageRow);
169 $result = $this->subject->addData($input);
171 $this->assertSame($parentPageRow, $result[
'parentPageRow']);