PhpOffice\PhpPresentation\Style\Font::setSubScript PHP Метод

setSubScript() публичный Метод

Set SubScript
public setSubScript ( boolean $pValue = false ) : Font
$pValue boolean
Результат Font
    public function setSubScript($pValue = false)
    {
        if ($pValue == '') {
            $pValue = false;
        }
        $this->subScript = $pValue;
        $this->superScript = !$pValue;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Test get/set subscript
  */
 public function testSetIsSubScript()
 {
     $object = new Font();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript());
     $this->assertFalse($object->isSubScript());
     $this->assertTrue($object->isSuperScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript(''));
     $this->assertFalse($object->isSubScript());
     $this->assertTrue($object->isSuperScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript(false));
     $this->assertFalse($object->isSubScript());
     $this->assertTrue($object->isSuperScript());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript(true));
     $this->assertTrue($object->isSubScript());
     $this->assertFalse($object->isSuperScript());
 }