Skip to content

Commit

Permalink
Update version and copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Feb 12, 2021
1 parent 7693529 commit ef5b7cc
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 75 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
tests/ export-ignore
phpunit.xml export-ignore
.travis.yml export-ignore
37 changes: 37 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: phpunit

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

#- name: Validate composer.json and composer.lock
# run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: composer run-script test
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3 Clause License

Copyright (c) 2009-2020, NOLA Interactive, LLC.
Copyright (c) 2009-2021, NOLA Interactive, LLC.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pop-dom
=======

[![Build Status](https://travis-ci.org/popphp/pop-dom.svg?branch=master)](https://travis-ci.org/popphp/pop-dom)
[![Build Status](https://github.com/popphp/pop-dom/workflows/phpunit/badge.svg)](https://github.com/popphp/pop-dom/actions)
[![Coverage Status](http://cc.popphp.org/coverage.php?comp=pop-dom)](http://cc.popphp.org/pop-dom/)

OVERVIEW
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
}
],
"require": {
"php": ">=7.1.0"
"php": ">=7.3.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0.0"
"phpunit/phpunit": "^9.0.0"
},
"autoload": {
"psr-4": {
Expand All @@ -35,9 +35,12 @@
"Pop\\Dom\\Test\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev"
"dev-master": "3.3.x-dev"
}
}
}
31 changes: 15 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Pop Dom Component PHPUnit Test">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="/tmp/pop-dom-cc" lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-text" showUncoveredFiles="true"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<report>
<html outputDirectory="/tmp/pop-dom-cc" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<testsuites>
<testsuite name="Pop Dom Component PHPUnit Test">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>
6 changes: 3 additions & 3 deletions src/AbstractNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
*/

Expand All @@ -19,9 +19,9 @@
* @category Pop
* @package Pop\Dom
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
* @version 3.2.7
* @version 3.3.0
*/
abstract class AbstractNode
{
Expand Down
6 changes: 3 additions & 3 deletions src/Child.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
*/

Expand All @@ -19,9 +19,9 @@
* @category Pop
* @package Pop\Dom
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
* @version 3.2.7
* @version 3.3.0
*/
class Child extends AbstractNode
{
Expand Down
6 changes: 3 additions & 3 deletions src/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
*/

Expand All @@ -19,9 +19,9 @@
* @category Pop
* @package Pop\Dom
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
* @version 3.2.7
* @version 3.3.0
*/
class Document extends AbstractNode
{
Expand Down
6 changes: 3 additions & 3 deletions src/DomIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
*/

Expand All @@ -19,9 +19,9 @@
* @category Pop
* @package Pop\Dom
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
* @version 3.2.7
* @version 3.3.0
*/
class DomIterator implements \RecursiveIterator
{
Expand Down
6 changes: 3 additions & 3 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
*/

Expand All @@ -19,8 +19,8 @@
* @category Pop
* @package Pop\Dom
* @author Nick Sagona, III <[email protected]>
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)
* @license http://www.popphp.org/license New BSD License
* @version 3.2.7
* @version 3.3.0
*/
class Exception extends \Exception {}
22 changes: 11 additions & 11 deletions tests/ChildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public function testRender()
'style' => 'display: block;'
]);
$child->addChild(new Child('p', 'Paragraph'));
$this->assertContains('<h1 id="header" style="display: block;">', (string)$child);
$this->assertContains('<p>Paragraph</p>', (string)$child);
$this->assertStringContainsString('<h1 id="header" style="display: block;">', (string)$child);
$this->assertStringContainsString('<p>Paragraph</p>', (string)$child);
}

public function testRenderChildrenFirst()
Expand All @@ -118,8 +118,8 @@ public function testRenderChildrenFirst()
'style' => 'display: block;'
]);
$child->addChild(new Child('p', 'Paragraph'));
$this->assertContains('<h1 id="header" style="display: block;">', (string)$child);
$this->assertContains('<p>Paragraph</p>', (string)$child);
$this->assertStringContainsString('<h1 id="header" style="display: block;">', (string)$child);
$this->assertStringContainsString('<p>Paragraph</p>', (string)$child);
}

public function testRenderNoNodeValue()
Expand Down Expand Up @@ -164,8 +164,8 @@ public function testGetNodeContent()

$body = $parent->getChild(1);
$content = $body->getNodeContent();
$this->assertContains('<strong>more</strong>', $content);
$this->assertNotContains('<body', $content);
$this->assertStringContainsString('<strong>more</strong>', $content);
$this->assertStringNotContainsString('<body', $content);
}

public function testGetTextContent()
Expand Down Expand Up @@ -204,8 +204,8 @@ public function testGetTextContent()

$body = $parent->getChild(1);
$content = $body->getTextContent();
$this->assertContains('more', $content);
$this->assertNotContains('<h1>', $content);
$this->assertStringContainsString('more', $content);
$this->assertStringNotContainsString('<h1>', $content);
}

public function testNodeWhiteSpace()
Expand Down Expand Up @@ -234,8 +234,8 @@ public function testCData()

$content = $child->render();
$this->assertTrue($child->isCData());
$this->assertContains('<![CDATA[', $content);
$this->assertContains(']]>', $content);
$this->assertStringContainsString('<![CDATA[', $content);
$this->assertStringContainsString(']]>', $content);
}

/**
Expand All @@ -247,7 +247,7 @@ public function testOutput()
ob_start();
echo $child;
$result = ob_get_clean();
$this->assertContains('<h1>Header</h1>', $result);
$this->assertStringContainsString('<h1>Header</h1>', $result);
}

}
12 changes: 6 additions & 6 deletions tests/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ public function testConstructor()
$this->assertInstanceOf('Pop\Dom\Document', $doc);
$this->assertEquals(' ', $doc->getIndent());
$this->assertEquals(1, count($doc->getChildren()));
$this->assertContains('<!DOCTYPE html>', $doc->getDoctype());
$this->assertStringContainsString('<!DOCTYPE html>', $doc->getDoctype());
}

public function testSetDoctype()
{
$doc = new Document();
$doc->setDoctype(Document::ATOM);
$this->assertContains('<?xml version=', $doc->getDoctype());
$this->assertStringContainsString('<?xml version=', $doc->getDoctype());
$doc->setDoctype(Document::RSS);
$this->assertContains('<?xml version=', $doc->getDoctype());
$this->assertStringContainsString('<?xml version=', $doc->getDoctype());
$doc->setDoctype(Document::XML);
$this->assertContains('<?xml version=', $doc->getDoctype());
$this->assertStringContainsString('<?xml version=', $doc->getDoctype());
}

public function testSetDoctypeException()
Expand Down Expand Up @@ -79,7 +79,7 @@ public function testRender()
new Child('title', 'Hello World'),
new Child('h1', 'Header')
]);
$this->assertContains('<h1>Header</h1>', (string)$doc);
$this->assertStringContainsString('<h1>Header</h1>', (string)$doc);
}

/**
Expand All @@ -94,7 +94,7 @@ public function testOutput()
echo $doc;
$result = ob_get_clean();

$this->assertContains('<h1>Header</h1>', $result);
$this->assertStringContainsString('<h1>Header</h1>', $result);
}

}
16 changes: 8 additions & 8 deletions tests/ParseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ public function testParseString()
$doc = new Document(Document::HTML);
$doc->addChild(Child::parseString($html));
$render = (string)$doc;
$this->assertContains('<title>Hello World Title</title>', $render);
$this->assertContains('class="top-header"', $render);
$this->assertContains('<p class="special-p">', $render);
$this->assertStringContainsString('<title>Hello World Title</title>', $render);
$this->assertStringContainsString('class="top-header"', $render);
$this->assertStringContainsString('<p class="special-p">', $render);
}

public function testParseFile()
{
$doc = new Document(Document::HTML);
$doc->addChild(Child::parseFile(__DIR__ . '/tmp/test.html'));
$render = (string)$doc;
$this->assertContains('<title>Hello World Title</title>', $render);
$this->assertContains('class="top-header"', $render);
$this->assertContains('<p class="special-p">', $render);
$this->assertStringContainsString('<title>Hello World Title</title>', $render);
$this->assertStringContainsString('class="top-header"', $render);
$this->assertStringContainsString('<p class="special-p">', $render);
}

public function testParseFileException()
Expand All @@ -59,8 +59,8 @@ public function testParsePartial()
$doc = new Document(Document::HTML);
$doc->addChildren(Child::parseString($html));
$render = (string)$doc;
$this->assertContains('class="top-header"', $render);
$this->assertContains('<p class="special-p">', $render);
$this->assertStringContainsString('class="top-header"', $render);
$this->assertStringContainsString('<p class="special-p">', $render);
}

}

0 comments on commit ef5b7cc

Please sign in to comment.