Skip to content
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

Tests/edit remove students #508

Merged
merged 17 commits into from
Nov 22, 2023
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: 7 additions & 7 deletions app/controllers/StudentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public function actionGetStudentAjax()
3 => 'inep_id',
4 => 'actions'
);

$criteria = new CDbCriteria();


// Filtrar a pesquisa
if (!empty($requestData['search']['value'])) {
$criteria->condition = "name LIKE '%" . $requestData['search']['value'] . "%' OR " .
Expand All @@ -129,7 +129,7 @@ public function actionGetStudentAjax()
$criteria->order = $sortColumn ." ". $sortDirection;




$students = StudentIdentification::model()->findAll($criteria);

Expand All @@ -142,7 +142,7 @@ public function actionGetStudentAjax()
$nestedData[] = $student->filiation_1;
$nestedData[] = $student->birthday;
$nestedData[] = $student->inep_id;
$nestedData[] = "<a style='cursor: pointer;' title='Editar' href='/?r=student/update&id=".$student->id."'>
$nestedData[] = "<a style='cursor: pointer;' title='Editar' id='student-edit' href='/?r=student/update&id=".$student->id."'>
<img src='" . Yii::app()->theme->baseUrl . '/img/editar.svg' . "' alt='Editar'></img>
</a>&nbsp;"
."<a style='cursor: pointer;' title='Excluir' id='student-delete' href='/?r=student/delete&id=".$student->id."'>
Expand Down Expand Up @@ -287,10 +287,10 @@ public function actionCreate()
$modelStudentDocumentsAndAddress->student_fk = $modelStudentIdentification->inep_id;
date_default_timezone_set("America/Recife");
$modelStudentIdentification->last_change = date('Y-m-d G:i:s');


if ($modelStudentIdentification->validate() && $modelStudentDocumentsAndAddress->validate()) {

if ($modelStudentIdentification->save()) {
$modelStudentDocumentsAndAddress->id = $modelStudentIdentification->id;
$modelStudentRestrictions->student_fk = $modelStudentIdentification->id;
Expand Down Expand Up @@ -355,7 +355,7 @@ public function actionCreate()
}


/**
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
Expand Down
22 changes: 20 additions & 2 deletions tests/acceptance/StudentsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public function addStudentsRapidFieldsRequired(AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -129,6 +131,8 @@ public function addStudentsRapidFieldsRequiredWithMotherAndFather(AcceptanceTest

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}


Expand Down Expand Up @@ -172,14 +176,14 @@ public function addStudentsRapidAllFilledIn (AcceptanceTester $teste)

// address
$robots->zone($dataStudent->studentDocument['residence_zone']);
$robots ->btnProximo();
$robots->btnProximo();
sleep(2);

// matriculation
$robots->btnAddMatriculation();
sleep(2);
$robots->classroom($dataStudent->studentEnrollment['classroom_fk']);
$robots ->btnProximo();
$robots->btnProximo();

// health
$robots->deficiency();
Expand All @@ -192,6 +196,8 @@ public function addStudentsRapidAllFilledIn (AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -254,6 +260,8 @@ public function addStudentsFieldsRequiredWithMotherAndFather (AcceptanceTester $

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -311,6 +319,8 @@ public function addStudentsFieldsRequired(AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -475,6 +485,8 @@ public function allFilledInNewCivilWithMotherAndFather (AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -584,6 +596,8 @@ public function allFilledInNewCivil (AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -715,6 +729,8 @@ public function allFilledInOldCivilWithMotherAndFather(AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

/**
Expand Down Expand Up @@ -835,6 +851,8 @@ public function allFilledInOldCivil(AcceptanceTester $teste)

$teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!');
$teste->canSeeInCurrentUrl('?r=student/index&');

return $dataStudent;
}

}
Loading