mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
This commit is contained in:
@@ -13,6 +13,7 @@ tests/codeception.yml
|
||||
tests/codeception/api.suite.yml
|
||||
tests/codeception/functional.suite.yml
|
||||
tests/codeception/acceptance.suite.yml
|
||||
tests/codeception/_support/_generated
|
||||
tests/codeception/_output/*
|
||||
!/tests/codeception/_output/.placeholder
|
||||
/submodules/d3
|
||||
|
||||
@@ -60,11 +60,7 @@ $autoload['packages'] = array();
|
||||
*/
|
||||
|
||||
//$autoload['libraries'] = array();
|
||||
$autoload['libraries'] = array('session', 'FHC_Auth');
|
||||
|
||||
//$autoload['libraries'] = array();
|
||||
$autoload['libraries'] = array('session');
|
||||
|
||||
$autoload['libraries'] = array('Session', 'FHC_Auth');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
|
||||
@@ -126,7 +126,6 @@ $config['rest_auth'] = 'basic';
|
||||
| Note: If 'rest_auth' is set to 'session' then change 'auth_source' to the name of the session variable
|
||||
|
|
||||
*/
|
||||
//$config['auth_source'] = 'RestAPISession';
|
||||
$config['auth_source'] = 'library';
|
||||
|
||||
/*
|
||||
@@ -145,7 +144,7 @@ $config['auth_source'] = 'library';
|
||||
| e.g: md5('admin:REST API:1234') = '1e957ebc35631ab22d5bd6526bd14ea2'
|
||||
|
|
||||
*/
|
||||
$config['auth_library_class'] = 'Fhcauth';
|
||||
$config['auth_library_class'] = 'FHC_Auth';
|
||||
$config['auth_library_function'] = 'auth';
|
||||
|
||||
/*
|
||||
@@ -164,7 +163,10 @@ $config['auth_library_function'] = 'auth';
|
||||
| $config['auth_override_class_method']['accounts']['user'] = 'basic';
|
||||
| $config['auth_override_class_method']['dashboard']['*'] = 'none|digest|basic';
|
||||
|
|
||||
| Here 'deals', 'accounts' and 'dashboard' are controller names, 'view', 'insert' and 'user' are methods within. An asterisk may also be used to specify an authentication method for an entire classes methods. Ex: $config['auth_override_class_method']['dashboard']['*'] = 'basic'; (NOTE: leave off the '_get' or '_post' from the end of the method name)
|
||||
| Here 'deals', 'accounts' and 'dashboard' are controller names, 'view', 'insert' and 'user' are methods within.
|
||||
* An asterisk may also be used to specify an authentication method for an entire classes methods.
|
||||
* Ex: $config['auth_override_class_method']['dashboard']['*'] = 'basic'; (NOTE: leave off the '_get' or '_post' from the end
|
||||
* of the method name)
|
||||
| Acceptable values are; 'none', 'digest' and 'basic'.
|
||||
|
|
||||
*/
|
||||
@@ -206,10 +208,10 @@ $config['auth_override_class_method_http']['Person']['personUpdate']['post'] = '
|
||||
| REST Login Usernames
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Array of usernames and passwords for login, if ldap is configured this is ignored
|
||||
| Array of usernames and passwords for login, if ldap (even library) is configured this is ignored
|
||||
|
|
||||
*/
|
||||
$config['rest_valid_logins'] = ['admin' => '1234'];
|
||||
$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -226,7 +228,7 @@ $config['rest_valid_logins'] = ['admin' => '1234'];
|
||||
| restrict certain methods to IPs in your whitelist
|
||||
|
|
||||
*/
|
||||
$config['rest_ip_whitelist_enabled'] = FALSE;
|
||||
$config['rest_ip_whitelist_enabled'] = TRUE;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -61,8 +61,8 @@ class APIAuth extends APIv1_Controller
|
||||
$httpstatus = null;
|
||||
$username = urldecode($this->get('username'));
|
||||
$password = urldecode($this->get('password'));
|
||||
|
||||
$account = $this->fhc_auth->auth($username, $password);
|
||||
|
||||
$account = $this->fhc_auth->auth($username, $password);
|
||||
|
||||
// perform login checks
|
||||
if (!$account)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
class Person extends REST_Controller
|
||||
class Person extends APIv1_Controller
|
||||
{
|
||||
|
||||
//public $session;
|
||||
@@ -24,181 +24,184 @@ class Person extends REST_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('person/person_model');
|
||||
$this->load->model('person/person_model');
|
||||
}
|
||||
|
||||
public function person_get()
|
||||
{
|
||||
//if (!$this->session_model->validate($this->get('session_id'), $this->get('device_id')))
|
||||
// $this->response(array(['success' => false, 'message' => 'access denied']), REST_Controller::HTTP_UNAUTHORIZED);
|
||||
//if (!$this->session_model->validate($this->get('session_id'), $this->get('device_id')))
|
||||
// $this->response(array(['success' => false, 'message' => 'access denied']), REST_Controller::HTTP_UNAUTHORIZED);
|
||||
|
||||
$code = $this->get('code');
|
||||
$email = $this->get('email');
|
||||
$person_id = $this->get('person_id');
|
||||
$code = $this->get('code');
|
||||
$email = $this->get('email');
|
||||
$person_id = $this->get('person_id');
|
||||
|
||||
if ((!is_null($code)) && (!is_null($email)))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCodeAndEmail($code, $email);
|
||||
}
|
||||
elseif (!is_null($person_id))
|
||||
{
|
||||
$result = $this->person_model->getPerson($person_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->person_model->getPerson();
|
||||
}
|
||||
if ((!is_null($code)) && (!is_null($email)))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCodeAndEmail($code, $email);
|
||||
}
|
||||
elseif (! is_null($code))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCode($code, $email);
|
||||
}
|
||||
elseif (!is_null($person_id))
|
||||
{
|
||||
$result = $this->person_model->getPerson($person_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->person_model->getPerson();
|
||||
}
|
||||
|
||||
if (empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Person not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// return all available persons
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Persons found'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
if (empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Person not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// return all available persons
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Persons found'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
// Set the response and exit
|
||||
$this->response($payload, $httpstatus);
|
||||
// Set the response and exit
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function personFromCode_post()
|
||||
{
|
||||
$code = $this->post('code');
|
||||
$email = $this->post('email');
|
||||
$person_id = $this->post('person_id');
|
||||
$code = $this->post('code');
|
||||
$email = $this->post('email');
|
||||
$person_id = $this->post('person_id');
|
||||
|
||||
if ((!is_null($code)) && (!is_null($email)))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCodeAndEmail($code, $email);
|
||||
}
|
||||
elseif (!is_null($person_id))
|
||||
{
|
||||
$result = $this->person_model->getPerson($person_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->person_model->getPerson();
|
||||
}
|
||||
if ((!is_null($code)) && (!is_null($email)))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCodeAndEmail($code, $email);
|
||||
}
|
||||
elseif (!is_null($person_id))
|
||||
{
|
||||
$result = $this->person_model->getPerson($person_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->person_model->getPerson();
|
||||
}
|
||||
|
||||
if (empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Person not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// return all available persons
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Persons found'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
if (empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Person not found'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// return all available persons
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Persons found'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
// Set the response and exit
|
||||
$this->response($payload, $httpstatus);
|
||||
// Set the response and exit
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function person_post()
|
||||
{
|
||||
$result = $this->person_model->savePerson($this->post());
|
||||
if($result != FALSE)
|
||||
{
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Person saved.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Could not save person.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
$result = $this->person_model->savePerson($this->post());
|
||||
if($result != FALSE)
|
||||
{
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Person saved.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Could not save person.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
$this->response($payload, $httpstatus);
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function personUpdate_post()
|
||||
{
|
||||
$result = $this->person_model->updatePerson($this->post());
|
||||
if($result != FALSE)
|
||||
{
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Person updated.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Could not update person.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
//
|
||||
$this->response($payload, $httpstatus);
|
||||
$result = $this->person_model->updatePerson($this->post());
|
||||
if($result != FALSE)
|
||||
{
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Person updated.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Could not update person.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
//
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function checkBewerbung_get()
|
||||
{
|
||||
$result = $this->person_model->checkBewerbung($this->get("email"),$this->get("studiensemester_kurzbz"));
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Bewerbung exists.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
$result = $this->person_model->checkBewerbung($this->get("email"),$this->get("studiensemester_kurzbz"));
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Bewerbung exists.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
|
||||
$this->response($payload, $httpstatus);
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
public function checkZugangscodePerson_get()
|
||||
{
|
||||
$result = $this->person_model->checkZugangscodePerson($this->get("code"));
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
if(!empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Zugangscode exists.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Zugangscode does not exist.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
$result = $this->person_model->checkZugangscodePerson($this->get("code"));
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
if(!empty($result))
|
||||
{
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'Zugangscode exists.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Zugangscode does not exist.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
|
||||
$this->response($payload, $httpstatus);
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,9 +36,14 @@ class Person extends APIv1_Controller
|
||||
// $this->response(array(['success' => false, 'message' => 'access denied']), REST_Controller::HTTP_UNAUTHORIZED);
|
||||
|
||||
$code = $this->get('code');
|
||||
$email = $this->get('email');
|
||||
$person_id = $this->get('person_id');
|
||||
|
||||
if (! is_null($code))
|
||||
if ((!is_null($code)) && (!is_null($email)))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCodeAndEmail($code, $email);
|
||||
}
|
||||
elseif (! is_null($code))
|
||||
{
|
||||
$result = $this->person_model->getPersonByCode($code);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,15 @@ class Person_model extends DB_Model
|
||||
->where("k.kontakt", $email);
|
||||
|
||||
return $this->db->get()->result_object();
|
||||
// $query = $this->db->get_where('public.tbl_person p ', array('zugangscode' => $code));
|
||||
// return $query->result_object();
|
||||
// }
|
||||
}
|
||||
|
||||
public function getPersonByCode($code)
|
||||
{
|
||||
// if ($this->fhc_db_acl->bb->isBerechtigt('person', 'suid'))
|
||||
// {
|
||||
$query = $this->db->get_where('public.tbl_person', array('zugangscode' => $code));
|
||||
return $query->result_object();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ build_settings:
|
||||
pgsql:
|
||||
host: 'localhost;dbname=template1'
|
||||
user: 'fhcomplete'
|
||||
pass: 'fhcomplete'
|
||||
pass: 'fhcomplete'
|
||||
setup:
|
||||
shell:
|
||||
- "pkill -f fhctest &"
|
||||
composer:
|
||||
directory: ""
|
||||
action: "install"
|
||||
|
||||
@@ -30752,7 +30752,7 @@ INSERT INTO tbl_aufmerksamdurch VALUES ('DivMessen', 'Diverse Messen', NULL);
|
||||
-- Data for Name: tbl_benutzer; Type: TABLE DATA; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
INSERT INTO tbl_benutzer VALUES ('administrator', 1, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO tbl_benutzer VALUES ('admin', 1, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO tbl_benutzer VALUES ('_DummyLektor', 2, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
@@ -36107,6 +36107,7 @@ INSERT INTO tbl_berechtigung VALUES ('assistenz', 'Assistenz');
|
||||
INSERT INTO tbl_berechtigung VALUES ('news', 'News eintragen');
|
||||
INSERT INTO tbl_berechtigung VALUES ('preinteressent', 'Verwaltung der Preinteressenten');
|
||||
INSERT INTO tbl_berechtigung VALUES ('veranstaltung', 'Berechtigungen fuer Veranstaltungen wie Jahresplan');
|
||||
INSERT INTO tbl_berechtigung VALUES ('basis/vilesci', 'Berechtigungen fuer VileSci');
|
||||
INSERT INTO tbl_berechtigung VALUES ('basis/berechtigung', 'Berechtigungsverwaltung');
|
||||
INSERT INTO tbl_berechtigung VALUES ('basis/variable', 'Variablenverwaltung');
|
||||
INSERT INTO tbl_berechtigung VALUES ('basis/studiengang', 'Studiengangsverwaltung');
|
||||
@@ -36242,6 +36243,7 @@ INSERT INTO tbl_rolleberechtigung VALUES ('basis/person', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('basis/studiengang', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('basis/testtool', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('basis/variable', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('basis/vilesci', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('info/news', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('info/veranstaltungsplan', 'admin', 'suid');
|
||||
INSERT INTO tbl_rolleberechtigung VALUES ('lehre/abgabetool', 'admin', 'suid');
|
||||
|
||||
@@ -9,17 +9,15 @@ settings:
|
||||
colors: true
|
||||
memory_limit: 1024M
|
||||
modules:
|
||||
enabled:
|
||||
- Db
|
||||
config:
|
||||
Db:
|
||||
dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest'
|
||||
user: 'fhcomplete'
|
||||
password: 'fhcomplete'
|
||||
dump: codeception/_data/dump.sql
|
||||
populate: true
|
||||
cleanup: false
|
||||
reconnect: false
|
||||
enabled:
|
||||
- Db:
|
||||
dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest'
|
||||
user: 'fhcomplete'
|
||||
password: 'fhcomplete'
|
||||
dump: codeception/_data/dump.sql
|
||||
populate: true
|
||||
cleanup: false
|
||||
reconnect: false
|
||||
coverage:
|
||||
enabled: true
|
||||
include:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,393 +0,0 @@
|
||||
<?php //[STAMP] ac0c4ccd4e75ef94ab4633dfbd798e7a
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
use Codeception\Module\Filesystem;
|
||||
use Codeception\Module\FunctionalHelper;
|
||||
|
||||
trait FunctionalTesterActions
|
||||
{
|
||||
/**
|
||||
* @return \Codeception\Scenario
|
||||
*/
|
||||
abstract protected function getScenario();
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Enters a directory In local filesystem.
|
||||
* Project root directory is used by default
|
||||
*
|
||||
* @param $path
|
||||
* @see \Codeception\Module\Filesystem::amInPath()
|
||||
*/
|
||||
public function amInPath($path) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Opens a file and stores it's content.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::openFile()
|
||||
*/
|
||||
public function openFile($filename) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteFile('composer.lock');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @see \Codeception\Module\Filesystem::deleteFile()
|
||||
*/
|
||||
public function deleteFile($filename) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes directory with all subdirectories
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->deleteDir('vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::deleteDir()
|
||||
*/
|
||||
public function deleteDir($dirname) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Copies directory with all contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->copyDir('vendor','old_vendor');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $src
|
||||
* @param $dst
|
||||
* @see \Codeception\Module\Filesystem::copyDir()
|
||||
*/
|
||||
public function copyDir($src, $dst) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function canSeeInThisFile($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has `text` in it.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeInThisFile()
|
||||
*/
|
||||
public function seeInThisFile($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has the `number` of new lines.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeNumberNewLines(5);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param int $number New lines
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeNumberNewLines()
|
||||
*/
|
||||
public function canSeeNumberNewLines($number) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has the `number` of new lines.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeNumberNewLines(5);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param int $number New lines
|
||||
* @see \Codeception\Module\Filesystem::seeNumberNewLines()
|
||||
*/
|
||||
public function seeNumberNewLines($number) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function canSeeFileContentsEqual($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks the strict matching of file contents.
|
||||
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
|
||||
* Better to use with HEREDOC strings.
|
||||
* Matching is done after removing "\r" chars from file content.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('process.pid');
|
||||
* $I->seeFileContentsEqual('3192');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
|
||||
*/
|
||||
public function seeFileContentsEqual($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function cantSeeInThisFile($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file doesn't contain `text` in it
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->dontSeeInThisFile('codeception/codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
|
||||
*/
|
||||
public function dontSeeInThisFile($text) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes a file
|
||||
* @see \Codeception\Module\Filesystem::deleteThisFile()
|
||||
*/
|
||||
public function deleteThisFile() {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function canSeeFileFound($filename, $path = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists in path.
|
||||
* Opens a file when it's exists
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFileFound('UserModel.php','app/models');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::seeFileFound()
|
||||
*/
|
||||
public function seeFileFound($filename, $path = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exist in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function cantSeeFileFound($filename, $path = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file does not exist in path
|
||||
*
|
||||
* @param $filename
|
||||
* @param string $path
|
||||
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
|
||||
*/
|
||||
public function dontSeeFileFound($filename, $path = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Erases directory contents
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->cleanDir('logs');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $dirname
|
||||
* @see \Codeception\Module\Filesystem::cleanDir()
|
||||
*/
|
||||
public function cleanDir($dirname) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Saves contents to file
|
||||
*
|
||||
* @param $filename
|
||||
* @param $contents
|
||||
* @see \Codeception\Module\Filesystem::writeToFile()
|
||||
*/
|
||||
public function writeToFile($filename, $contents) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
|
||||
}
|
||||
}
|
||||
@@ -1,344 +0,0 @@
|
||||
<?php //[STAMP] 5b9926709c0cff5b7af2d9cd7120bf7a
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
use Codeception\Module\Asserts;
|
||||
use Codeception\Module\UnitHelper;
|
||||
|
||||
trait UnitTesterActions
|
||||
{
|
||||
/**
|
||||
* @return \Codeception\Scenario
|
||||
*/
|
||||
abstract protected function getScenario();
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are equal.
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertEquals()
|
||||
*/
|
||||
public function assertEquals($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are not equal
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotEquals()
|
||||
*/
|
||||
public function assertNotEquals($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are same
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertSame()
|
||||
*/
|
||||
public function assertSame($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are not same
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotSame()
|
||||
*/
|
||||
public function assertNotSame($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that actual is greater than expected
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThan()
|
||||
*/
|
||||
public function assertGreaterThan($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThen()
|
||||
*/
|
||||
public function assertGreaterThen($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that actual is greater or equal than expected
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
|
||||
*/
|
||||
public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
|
||||
*/
|
||||
public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that actual is less than expected
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertLessThan()
|
||||
*/
|
||||
public function assertLessThan($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that actual is less or equal than expected
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertLessThanOrEqual()
|
||||
*/
|
||||
public function assertLessThanOrEqual($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that haystack contains needle
|
||||
*
|
||||
* @param $needle
|
||||
* @param $haystack
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertContains()
|
||||
*/
|
||||
public function assertContains($needle, $haystack, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that haystack doesn't contain needle.
|
||||
*
|
||||
* @param $needle
|
||||
* @param $haystack
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotContains()
|
||||
*/
|
||||
public function assertNotContains($needle, $haystack, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that string match with pattern
|
||||
*
|
||||
* @param string $pattern
|
||||
* @param string $string
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertRegExp()
|
||||
*/
|
||||
public function assertRegExp($pattern, $string, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that string not match with pattern
|
||||
*
|
||||
* @param string $pattern
|
||||
* @param string $string
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotRegExp()
|
||||
*/
|
||||
public function assertNotRegExp($pattern, $string, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that variable is empty.
|
||||
*
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertEmpty()
|
||||
*/
|
||||
public function assertEmpty($actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that variable is not empty.
|
||||
*
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotEmpty()
|
||||
*/
|
||||
public function assertNotEmpty($actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that variable is NULL
|
||||
*
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNull()
|
||||
*/
|
||||
public function assertNull($actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that variable is not NULL
|
||||
*
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertNotNull()
|
||||
*/
|
||||
public function assertNotNull($actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that condition is positive.
|
||||
*
|
||||
* @param $condition
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertTrue()
|
||||
*/
|
||||
public function assertTrue($condition, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that condition is negative.
|
||||
*
|
||||
* @param $condition
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertFalse()
|
||||
*/
|
||||
public function assertFalse($condition, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file exists
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertFileExists()
|
||||
*/
|
||||
public function assertFileExists($filename, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks if file doesn't exist
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertFileNotExists()
|
||||
*/
|
||||
public function assertFileNotExists($filename, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Fails the test with message.
|
||||
*
|
||||
* @param $message
|
||||
* @see \Codeception\Module\Asserts::fail()
|
||||
*/
|
||||
public function fail($message) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,15 @@ modules:
|
||||
enabled:
|
||||
- PhpBrowser
|
||||
- AcceptanceHelper
|
||||
- Db
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://admin:1q2w3@localhost/build/'
|
||||
Db:
|
||||
dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest'
|
||||
user: 'fhcomplete'
|
||||
password: 'fhcomplete'
|
||||
dump: codeception/_data/dump.sql
|
||||
populate: true
|
||||
cleanup: false
|
||||
reconnect: false
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('test the Login API');
|
||||
$I->haveHttpHeader('FHC-API-KEY', 'testapikey@fhcomplete.org');
|
||||
$I->sendGET('AuthAPI/login?username=pam&password=1q2w3&FHC-API-KEY=testapikey@fhcomplete.org');
|
||||
$I->seeResponseCodeIs(200);
|
||||
//$I->haveHttpHeader('username', 'testapikey@fhcomplete.org');
|
||||
//$I->haveHttpHeader('password', 'testapikey@fhcomplete.org');
|
||||
$I->sendPOST('AuthAPI/login?username=admin&password=1q2w3');
|
||||
/*$I->seeResponseCodeIs(200);
|
||||
$I->seeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'success' => true,
|
||||
'message' => 'User successfully logged in']);
|
||||
'message' => 'User successfully logged in']);*/
|
||||
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user