Hello, in this week I have finished my works on templates of table related scripts. They are covered in PR 1700.
Files Covered In This Week
Outcomes In This Week
Templates for table related scripts
Firstly, the tbl_indexes.lib.php and tbl_gis_visualization.lib.php is the two easiest for me. The most challenging script is the TableSearch.class.php, since HTML generation functions are usually reference to private helper functions and member variables by using
$this. To solve this problem, I took out HTMLs from these helper functions and integrate them into where there were referenced before. Further, I kept contents from some of these function as common templates. By templating on table related scripts, it will be easier for me to move on in the next phase of work.
The Problem I am Facing
There are so many assertion on HTML tags in unit test. For example, the following code will fail the test below but it just work fine in our browser:
class="create_table _form ajax lockpage">
The unit test code:
$this->assertContains('<form method="post" action="tbl_create.php" '
. 'class="create_table _form ajax lockpage">', $result);
Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet.
Could you give me some suggestions about this?
What will I Do Next
Since I have two final examations in the next week, I will leave from work temporarily until June 5th. By the moment I will start working on creating preliminary classes of table related scripts.