1
This commit is contained in:
34
vendor/phpoffice/math/tests/Math/Element/SemanticsTest.php
vendored
Normal file
34
vendor/phpoffice/math/tests/Math/Element/SemanticsTest.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\PhpOffice\Math\Element;
|
||||
|
||||
use PhpOffice\Math\Element\Semantics;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SemanticsTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$semantics = new Semantics();
|
||||
|
||||
$this->assertIsArray($semantics->getAnnotations());
|
||||
$this->assertCount(0, $semantics->getAnnotations());
|
||||
}
|
||||
|
||||
public function testAnnotation(): void
|
||||
{
|
||||
$semantics = new Semantics();
|
||||
|
||||
$this->assertIsArray($semantics->getAnnotations());
|
||||
$this->assertCount(0, $semantics->getAnnotations());
|
||||
|
||||
$this->assertInstanceOf(Semantics::class, $semantics->addAnnotation('encoding', 'content'));
|
||||
$this->assertEquals(['encoding' => 'content'], $semantics->getAnnotations());
|
||||
$this->assertCount(1, $semantics->getAnnotations());
|
||||
|
||||
$this->assertEquals('content', $semantics->getAnnotation('encoding'));
|
||||
$this->assertNull($semantics->getAnnotation('notexisting'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user