Files
ROC/library/persistence/mysql/tests/application.e
Jocelyn Fiat 8d59d25ace Added weight into to the CMS_LINK and provide a `sort' feature for CMS_MENU and related.
Protected cms service from registering many time the same module type.
Moved library/persistence/implementation/* under library/persistence/.
Moved site/www/themes to site/themes
For SQLite storage driver, auto create sqlite db file using associated sql script (to be completed).
Added code in demo module to reuse storage for module purpose.
Always call sql_post_execution in sql_query and sql_change, and not anymore by the callers.
Removed is_web and is_html from {CMS_SETUP}, it was not used.
Reused SHARED_*_ENCODER in CMS_ENCODERS
Added CMS_API.logger rather than using directly the SHARED_LOGGER.log ...
Centralize the implementation of current_user in CMS_REQUEST_UTIL
Removed the inheritance on WSF_FILTER for node handlers, since it is useless and unused.
Added CMS_NODE_API and CMS_USER_API
Prefix html id for block generated html items with "block-", to avoid css name conflict on "main", "content" or similar.
Code cleaning
2015-02-16 13:01:06 +01:00

73 lines
1.7 KiB
Plaintext

note
description : "tests application root class"
date : "$Date: 2015-01-27 19:15:02 +0100 (mar., 27 janv. 2015) $"
revision : "$Revision: 96542 $"
class
APPLICATION
inherit
ARGUMENTS
create
make
feature {NONE} -- Initialization
make
-- Run application.
local
storage: CMS_STORAGE
l_node: CMS_NODE
do
create connection.login_with_schema ("cms_dev", "root", "")
(create {CLEAN_DB}).clean_db(connection)
create {CMS_STORAGE_MYSQL} storage.make (connection)
l_node := custom_node ("Content", "Summary", "Title")
storage.new_user (default_user)
storage.new_user (custom_user ("u2", "p2", "e2"))
l_node.set_author (storage.user_by_email (default_user.email))
storage.new_node (l_node)
if attached {CMS_NODE} storage.node_by_id (1) as ll_node then
storage.update_node_title (2,ll_node.id, "New Title")
check
attached {CMS_NODE} storage.node_by_id (1) as u_node and then not (u_node.title ~ ll_node.title) and then u_node.content ~ ll_node.content and then u_node.summary ~ ll_node.summary
end
end
end
feature {NONE} -- Fixture Factory: Users
default_user: CMS_USER
do
Result := custom_user ("test", "password", "test@test.com")
end
custom_user (a_name, a_password, a_email: READABLE_STRING_32): CMS_USER
do
create Result.make (a_name)
Result.set_password (a_password)
Result.set_email (a_email)
end
feature {NONE} -- Implementation
connection: DATABASE_CONNECTION_MYSQL
default_node: CMS_NODE
do
Result := custom_node ("Default content", "default summary", "Default")
end
custom_node (a_content, a_summary, a_title: READABLE_STRING_32): CMS_NODE
do
create Result.make (a_content, a_summary, a_title)
end
end