Skip to content

Commit

Permalink
test for codeception.yaml in random subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrl-f5 committed Dec 21, 2020
1 parent a5dc57d commit f01b3d7
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 4 deletions.
16 changes: 16 additions & 0 deletions tests/cli/CodeceptionYmlInRandomDirCest.php
@@ -0,0 +1,16 @@
<?php
class CodeceptionYmlInRandomDirCest
{
/**
* @param CliGuy $I
*/
public function runTestPath(\CliGuy $I)
{
$I->amInPath('tests/data/codeception_yml_in_random_dir');
$I->executeCommand('run -c random/subdir/codeception.yml tests/unit/ExampleCest.php');

$I->seeResultCodeIs(0);
$I->dontSeeInShellOutput('RuntimeException');
$I->dontSeeInShellOutput('could not be found');
}
}
@@ -0,0 +1,8 @@
actor: Tester
paths:
tests: ../../tests
log: ../../tests/_output
data: ../../tests/_data
support: ../../tests/_support
settings:
bootstrap: ../../tests/_bootstrap.php
2 changes: 2 additions & 0 deletions tests/data/codeception_yml_in_random_dir/tests/_bootstrap.php
@@ -0,0 +1,2 @@
<?php
// This is global bootstrap for autoloading
@@ -0,0 +1,2 @@
*
!.gitignore
@@ -0,0 +1,26 @@
<?php


/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
*
* @SuppressWarnings(PHPMD)
*/
class UnitTester extends \Codeception\Actor
{
use _generated\UnitTesterActions;

/**
* Define custom actions here
*/
}
@@ -0,0 +1,2 @@
*
!.gitignore
8 changes: 8 additions & 0 deletions tests/data/codeception_yml_in_random_dir/tests/unit.suite.yml
@@ -0,0 +1,8 @@
# Codeception Test Suite Configuration
#
# Suite for unit (internal) tests.

class_name: UnitTester
modules:
enabled:
- Asserts
@@ -0,0 +1,9 @@
<?php

class ExampleCest
{
public function successful(UnitTester $I)
{
$I->assertTrue(true);
}
}
@@ -0,0 +1,2 @@
<?php
// Here you can initialize variables that will be available to your tests
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"></xs:schema>
<note>
<to>Son</to>
<from>Vader</from>
<heading>Disclaimer</heading>
<body>I'm your father!</body>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

0 comments on commit f01b3d7

Please sign in to comment.