/** * @test */ public function addDataThrowsExceptionIfDatabaseFetchingReturnsInvalidRowResultData() { $input = ['tableName' => 'tt_content', 'command' => 'edit', 'vanillaUid' => 10]; $this->dbProphecy->quoteStr(Argument::cetera())->willReturn($input['tableName']); $this->dbProphecy->exec_SELECTgetSingleRow(Argument::cetera())->willReturn('invalid result data'); $this->setExpectedException(\UnexpectedValueException::class, '', 1437656323); $this->subject->addData($input); }
/** * @test */ public function addDataSetsParentPageRowOnParentIfCommandIsEdit() { $input = ['tableName' => 'tt_content', 'command' => 'edit', 'vanillaUid' => 123, 'databaseRow' => ['uid' => 123, 'pid' => 321]]; $parentPageRow = ['uid' => 321, 'pid' => 456]; $this->dbProphecy->quoteStr(Argument::cetera())->willReturnArgument(0); $this->dbProphecy->exec_SELECTgetSingleRow('*', 'pages', 'uid=321')->willReturn($parentPageRow); $result = $this->subject->addData($input); $this->assertSame($parentPageRow, $result['parentPageRow']); }