Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
18.75% covered (danger)
18.75%
3 / 16
CRAP
40.91% covered (danger)
40.91%
9 / 22
MockPageConfig
0.00% covered (danger)
0.00%
0 / 1
18.75% covered (danger)
18.75%
3 / 16
153.96
40.91% covered (danger)
40.91%
9 / 22
 __construct
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
7 / 7
 getContentModel
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 hasLintableContentModel
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getTitle
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getNs
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getPageId
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getPageLanguage
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getPageLanguageDir
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getRevisionId
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getParentRevisionId
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionTimestamp
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionUser
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionUserId
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionSha1
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionSize
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getRevisionContent
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
<?php
declare( strict_types = 1 );
namespace Wikimedia\Parsoid\Mocks;
use Wikimedia\Parsoid\Config\PageConfig;
use Wikimedia\Parsoid\Config\PageContent;
class MockPageConfig extends PageConfig {
    /** @var ?PageContent */
    private $content;
    /** @var int */
    private $pageid;
    /** @var int */
    private $pagens;
    /** @var string */
    private $title;
    /** @var ?string */
    private $pagelanguage;
    /** @var ?string */
    private $pagelanguageDir;
    /**
     * Construct a mock environment object for use in tests
     * @param array $opts
     * @param ?PageContent $content
     */
    public function __construct( array $opts, ?PageContent $content ) {
        $this->content = $content;
        $this->title = $opts['title'] ?? 'TestPage';
        $this->pageid = $opts['pageid'] ?? -1;
        $this->pagens = $opts['pagens'] ?? 0;
        $this->pagelanguage = $opts['pageLanguage'] ?? null;
        $this->pagelanguageDir = $opts['pageLanguageDir'] ?? null;
    }
    /** @inheritDoc */
    public function getContentModel(): string {
        return 'wikitext';
    }
    public function hasLintableContentModel(): bool {
        return true;
    }
    /** @inheritDoc */
    public function getTitle(): string {
        return $this->title;
    }
    /** @inheritDoc */
    public function getNs(): int {
        return $this->pagens;
    }
    /** @inheritDoc */
    public function getPageId(): int {
        return $this->pageid;
    }
    /** @inheritDoc */
    public function getPageLanguage(): string {
        return $this->pagelanguage ?? 'en';
    }
    /** @inheritDoc */
    public function getPageLanguageDir(): string {
        return $this->pagelanguageDir ?? 'rtl';
    }
    /** @inheritDoc */
    public function getRevisionId(): ?int {
        return 1;
    }
    /** @inheritDoc */
    public function getParentRevisionId(): ?int {
        return null;
    }
    /** @inheritDoc */
    public function getRevisionTimestamp(): ?string {
        return null;
    }
    /** @inheritDoc */
    public function getRevisionUser(): ?string {
        // @phan-suppress-previous-line PhanPluginNeverReturnMethod
        throw new \BadMethodCallException( 'Not implemented' );
    }
    /** @inheritDoc */
    public function getRevisionUserId(): ?int {
        // @phan-suppress-previous-line PhanPluginNeverReturnMethod
        throw new \BadMethodCallException( 'Not implemented' );
    }
    /** @inheritDoc */
    public function getRevisionSha1(): ?string {
        return null;
    }
    /** @inheritDoc */
    public function getRevisionSize(): ?int {
        // @phan-suppress-previous-line PhanPluginNeverReturnMethod
        throw new \BadMethodCallException( 'Not implemented' );
    }
    /** @inheritDoc */
    public function getRevisionContent(): ?PageContent {
        return $this->content;
    }
}