Skip to content

Convert tests to use PHPUnit, and add to CI #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI

on:
# Run on all pushes to master and on all pull requests.
push:
branches:
master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
uses: "zetacomponents/.github/.github/workflows/ci.yml@master"
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"zetacomponents/template": "~1.4"
},
"require-dev": {
"zetacomponents/unit-test": "*"
"zetacomponents/unit-test": "*",
"phpunit/phpunit": "^9.0"
}
}
25 changes: 12 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Zeta Components MvcTemplateTiein">
<directory suffix="_test.php">./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" convertDeprecationsToExceptions="true">
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Zeta Components MvcTemplateTiein">
<directory suffix="_test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 5 additions & 5 deletions tests/views/template.php → tests/views/template-tiein_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -24,7 +24,7 @@
* @package MvcTemplateTiein
* @subpackage Tests
*/
require_once 'MvcTemplateTiein/tests/testfiles/testclasses.php';
require_once __DIR__ . '/../testfiles/testclasses.php';

/**
* Test the handler classes.
Expand All @@ -34,7 +34,7 @@
*/
class ezcMvcTemplateViewTest extends ezcTestCase
{
function setUp()
function setUp() : void
{
$this->baseDir = dirname( __FILE__ ) . '/../testfiles/views/template/';
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testNonExistingFile()

public static function suite()
{
return new PHPUnit_Framework_TestSuite( "ezcMvcTemplateViewTest" );
return new PHPUnit\Framework\TestSuite( "ezcMvcTemplateViewTest" );
}
}
?>
Loading