Google\Spreadsheet\CellFeed::editCell PHP Method

editCell() public method

So the first column of the first row will be (1,1).
public editCell ( integer $rowNum, integer $colNum, string $value ) : void
$rowNum integer Row number
$colNum integer Column number
$value string Can also be a formula
return void
    public function editCell($rowNum, $colNum, $value)
    {
        $entry = new \SimpleXMLElement("\n            <entry\n                xmlns=\"http://www.w3.org/2005/Atom\"\n                xmlns:gs=\"http://schemas.google.com/spreadsheets/2006\">\n            </entry>\n        ");
        $child = $entry->addChild("xmlns:gs:cell");
        $child->addAttribute("row", $rowNum);
        $child->addAttribute("col", $colNum);
        $child->addAttribute("inputValue", $value);
        ServiceRequestFactory::getInstance()->post($this->getPostUrl(), $entry->asXML());
    }

Usage Example

 public function testEditCell()
 {
     $feed = new CellFeed($this->getSimpleXMLElement("cell-feed"));
     $mockServiceRequest = $this->getMockBuilder(DefaultServiceRequest::class)->setMethods(array("post"))->disableOriginalConstructor()->getMock();
     $mockServiceRequest->expects($this->once())->method("post")->with($this->equalTo("https://spreadsheets.google.com/feeds/cells/15L06yklgflGRDjnN-VvhGYOoVLCH40DJoW5fFiqSTc5U/od6/private/full"), $this->stringContains("<entry"));
     ServiceRequestFactory::setInstance($mockServiceRequest);
     $feed->editCell(2, 1, "Test");
 }