PhpOffice\PhpPresentation\Style\Font::setSuperScript PHP Method

setSuperScript() public method

Set SuperScript
public setSuperScript ( boolean $pValue = false ) : Font
$pValue boolean
return Font
    public function setSuperScript($pValue = false)
    {
        if ($pValue == '') {
            $pValue = false;
        }
        $this->superScript = $pValue;
        $this->subScript = !$pValue;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Test get/set superscript
  */
 public function testSetIsSuperScript()
 {
     $object = new Font();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript());
     $this->assertFalse($object->isSuperScript());
     $this->assertTrue($object->isSubScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript(''));
     $this->assertFalse($object->isSuperScript());
     $this->assertTrue($object->isSubScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript(false));
     $this->assertFalse($object->isSuperScript());
     $this->assertTrue($object->isSubScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript(true));
     $this->assertTrue($object->isSuperScript());
     $this->assertFalse($object->isSubScript());
 }