Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
7eed1370
Commit
7eed1370
authored
May 30, 2018
by
Bertrand Gauthier
Browse files
Réorganisation config phpunit
parent
3f460c17
Changes
3
Hide whitespace changes
Inline
Side-by-side
phpunit.xml
0 → 100644
View file @
7eed1370
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap=
"vendor/autoload.php"
colors=
"true"
>
<testsuites>
<testsuite
name=
"unit"
>
<directory>
./tests/UnicaenAuthTest
</directory>
</testsuite>
</testsuites>
<filter>
<whitelist
processUncoveredFilesFromWhitelist=
"true"
>
<directory
suffix=
".php"
>
./src
</directory>
</whitelist>
</filter>
<!--<php>-->
<!--<!– Integration Test Variables –>-->
<!--<const name="HOST" value="localhost"/>-->
<!--<const name="PORT" value="4444"/>-->
<!--<const name="BROWSER_URL" value="http://localhost/snortlog/"/> <!– '/' requis à la fin! –>-->
<!--<const name="CAS_URL" value="https://cas.unicaen.fr/"/> <!– '/' requis à la fin! –>-->
<!--<const name="USERNAME" value="21009539"/>-->
<!--<const name="PASSWORD" value="UCBN2010"/>-->
<!--</php>-->
</phpunit>
\ No newline at end of file
tests/Bootstrap.php
deleted
100644 → 0
View file @
3f460c17
<?php
namespace
UnicaenAppTest
;
use
Zend\Loader\AutoloaderFactory
;
use
Zend\Mvc\Service\ServiceManagerConfig
;
use
Zend\ServiceManager\ServiceManager
;
use
RuntimeException
;
error_reporting
(
E_ALL
|
E_STRICT
);
chdir
(
__DIR__
);
/**
* Test bootstrap, for setting up autoloading
*/
class
Bootstrap
{
protected
static
$serviceManager
;
public
static
function
init
()
{
$zf2ModulePaths
=
[
dirname
(
dirname
(
__DIR__
))];
if
((
$path
=
static
::
findParentPath
(
'vendor'
)))
{
$zf2ModulePaths
[]
=
$path
;
}
if
((
$path
=
static
::
findParentPath
(
'module'
))
!==
$zf2ModulePaths
[
0
])
{
$zf2ModulePaths
[]
=
$path
;
}
$zf2ModulePaths
[]
=
__DIR__
;
static
::
initAutoloader
();
static
::
$serviceManager
=
new
ServiceManager
(
new
ServiceManagerConfig
());
}
public
static
function
getServiceManager
()
{
return
static
::
$serviceManager
;
}
protected
static
function
initAutoloader
()
{
$vendorPath
=
static
::
findParentPath
(
'vendor'
);
if
(
is_readable
(
$vendorPath
.
'/autoload.php'
))
{
include
$vendorPath
.
'/autoload.php'
;
return
;
}
$zf2Path
=
getenv
(
'ZF2_PATH'
);
if
(
!
$zf2Path
)
{
if
(
defined
(
'ZF2_PATH'
))
{
$zf2Path
=
ZF2_PATH
;
}
elseif
(
is_dir
(
$vendorPath
.
'/ZF2/library'
))
{
$zf2Path
=
$vendorPath
.
'/ZF2/library'
;
}
elseif
(
is_dir
(
$vendorPath
.
'/zendframework/zendframework/library'
))
{
$zf2Path
=
$vendorPath
.
'/zendframework/zendframework/library'
;
}
}
if
(
!
$zf2Path
)
{
throw
new
RuntimeException
(
'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'
);
}
include
$zf2Path
.
'/Zend/Loader/AutoloaderFactory.php'
;
AutoloaderFactory
::
factory
([
'Zend\Loader\StandardAutoloader'
=>
[
'autoregister_zf'
=>
true
,
'namespaces'
=>
[
__NAMESPACE__
=>
__DIR__
.
'/'
.
__NAMESPACE__
,
],
],
]);
}
protected
static
function
findParentPath
(
$path
)
{
$dir
=
__DIR__
;
$previousDir
=
'.'
;
while
(
!
is_dir
(
$dir
.
'/'
.
$path
))
{
$dir
=
dirname
(
$dir
);
if
(
$previousDir
===
$dir
)
return
false
;
$previousDir
=
$dir
;
}
return
$dir
.
'/'
.
$path
;
}
}
Bootstrap
::
init
();
\ No newline at end of file
tests/phpunit.xml
deleted
100644 → 0
View file @
3f460c17
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap=
"./Bootstrap.php"
colors=
"true"
>
<testsuites>
<testsuite
name=
"unit"
>
<directory>
./UnicaenAuthTest
</directory>
</testsuite>
<testsuite
name=
"functional"
>
<directory>
./functional
</directory>
</testsuite>
</testsuites>
<logging>
<!--<log type="junit" target="/tmp/phpunit/logs/junit.xml" />-->
<!--<log type="coverage-clover" target="/tmp/phpunit/logs/clover.xml" />-->
<!--<log type="coverage-html" target="/tmp/phpunit/coverage" />-->
</logging>
<filter>
<whitelist
processUncoveredFilesFromWhitelist=
"true"
>
<directory
suffix=
".php"
>
../src
</directory>
</whitelist>
</filter>
<!--
<groups>
<exclude>
<group>disable</group>
<group>integration</group>
<group>integration-sqlserver</group>
</exclude>
</groups>
-->
<php>
<!-- Integration Test Variables -->
<const
name=
"HOST"
value=
"localhost"
/>
<const
name=
"PORT"
value=
"4444"
/>
<const
name=
"BROWSER_URL"
value=
"http://localhost/snortlog/"
/>
<!-- '/' requis à la fin! -->
<const
name=
"CAS_URL"
value=
"https://cas.unicaen.fr/"
/>
<!-- '/' requis à la fin! -->
<const
name=
"USERNAME"
value=
"21009539"
/>
<const
name=
"PASSWORD"
value=
"UCBN2010"
/>
</php>
</phpunit>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment